アニメーションの実行後にコードをリンクにたどらせようとしています。
アイデアは、「Gnoll」がボタンを押すと、リンクに移動するというものです。
これはこれまでの私のコードです:
内部にリンクがありません。
(また、ボタンの色は「ヒット」アニメーションの途中で変わるはずです。これまでのところ、私はそれで失敗しています)
$(document).ready(function(){
$('.Homebutton').click(function(){
$('.animateme').html('<img src="Construct2/Images/Gnoll_Running.gif" />');
$('.animateme').animate({
left: '+=150',
}, 800, function() {
$('.animateme').html('<img src="Construct2/Images/Gnoll_Hit.gif" />');
});
$('.animateme').animate({
left: '+=0',
}, 500);
$('.animateme').animate({
left: '+=0',
}, 500, function() {
$('.animateme') .html('<img src="Construct2/Images/Gnoll_Resting_smaller.gif" />');
});
});
$('#AddOnbutton').click(function(){
$('.animateme').html('<img src="Construct2/Images/Gnoll_Running.gif" />');
$('.animateme').animate({
left: '+=250',
}, 1000, function() {
$('.animateme').html('<img src="Construct2/Images/Gnoll_Hit.gif" />')
});
$('.animateme').animate({
left: '+=0',
}, 1000, function() {
$('.animateme') .html('<img src="Construct2/Images/Gnoll_Resting_smaller.gif" />');
$("#AddOnbutton").html('<img src="Construct2/Images/redbutton.png" />');
});
});
});
ご覧のとおり、コードは非常に基本的です。リンクは、最後のリンクから約 0.5 秒後にトリガーされます。
$('.animateme') .html('<img src="Construct2/Images/Gnoll_Resting_smaller.gif" />');