html
1<div class="content_txt"> 2 <p>texttext</p> 3 <a href="#" class="link"> 4 <div class="button"></div> 5 </a> 6 </div> 7 <div class="content_img"> 8 <a href="#" class="link"> 9 <div class="image"> 10 <img src="img.png"/> 11 </div> 12 </a> 13 </div>
css
1/*ホバー処理A*/ 2.button::before{ 3 position: absolute; 4 content: ""; 5 top: 20px; 6 left: 20px; 7 width: 64px; 8 height:2px; 9 background-color:#999; 10 transition: all linear 0.3s; 11} 12.button::after{ 13 position: absolute; 14 content: ""; 15 top: 15px; 16 left: 70px; 17 width: 12px; 18 height: 12px; 19 border-top: 2px solid #999; 20 transform: rotate(45deg); 21 transition: all linear 0.3s; 22} 23.link:hover .button:before { 24 left: 70px; 25 width: 130px; 26 background: #c30d23; 27} 28.link:hover .button:after { 29 left:186px; 30 border-top: 2px solid #c30d23; 31} 32 33/*ホバー処理B*/ 34.link:hover .image img{ 35 filter:brightness(100%); 36 -webkit-animation: flash 1.5s; 37 animation: flash 1.5s; 38 } 39 @-webkit-keyframes flash { 40 0% { 41 filter:brightness(40%); 42 } 43 100% { 44 filter: brightness(300%); 45 } 46 } 47 @keyframes flash { 48 0% { 49 filter:brightness(40%); 50 } 51 100% { 52 filter: brightness(300%); 53 } 54 }
js
1<script> 2 $(function() { 3 $(".content_txt a").hover( //ここをホバーすると、《矢印ビヨーンすると》 4 function() { 5 $(".content_img .image img").同時にhover(); //ここもホバーした状態になる。《画像も同時にキラリ》 6 } 7 ); 8}); 9</script>
この二つを同時に行いたいのです。
《矢印ビヨーン》《画像キラリ》
google先生に【jquery 別要素 追加 イベント】などで聞いては見たのですが、
スキルが低いので実際に使えそうな記事に出会えてません。。。
add要素 + 同時hover
のような都合のいいものはないでしょうか。。。???
よろしくお願いします!
回答2件
あなたの回答
tips
プレビュー