id=canonをクリックするとid=matchが所定の位置に出現するようにしたいのですが、
fadeInとかanimateなどを使っても何も反応を示さないので、それを解決してほしいです。
どうぞよろしくお願いします。
HTML5
1コード 2 3 <div id="shoot"> 4 <figure class="img1"><img src="images/canon.png" alt="canon" id="canon"></figure> 5 <figure class="img2"><img src="images/machi.png" alt="machi" id="match"></figure> 6 <figure class="img3"><img src="images/firework.png" alt="firework" id="fire"></figure>
css3
1コード.firework { 2 position: relative; 3 height: 100%; 4} 5 6#canon { 7 position: absolute; 8 right: 30px; 9 bottom: 0; 10} 11 12.img2 { 13 position: absolute; 14 right: -100px; 15 bottom: 50px; 16} 17 18.img3 { 19 position: absolute; 20 right: -30px; 21 top: 0; 22} 23 24#match { 25 opacity: 0; 26}
javascript
1コード$(function (){ 2 3 $('#canon').on('click'),function() { 4 matchin; 5 } 6 7 function matchin() { 8 9 $('#match').animate({opacity: 1},500,function() { 10 $('#match').css('right','-100px'); 11 }); 12 13 } 14 15});
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/04/04 04:38