Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Animation Callback
    primarykey
    data
    text
    <p>ill be brief.</p> <p>I found a piece of code and have changed it up quite a bit and it kinda seems to work.</p> <pre><code>&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('dota').click(function(){ }); $('#Homebutton').toggle(function(){ $('.animateme').html('&lt;img src="Construct2/Images/Gnoll_Running.gif" /&gt;'); $('.animateme').animate({ left: '+=150', }, 800, function() { $('.animateme').html('&lt;img src="Construct2/Images/Gnoll_Hit.gif" /&gt;'); }); $('.animateme').animate({ left: '+=0', }, 500); $('#Homebutton').html('&lt;img src="Construct2/Images/buttonred.png" /&gt;'); $('.animateme').animate({ left: '+=0', }, 500, function() { $('.animateme') .html('&lt;img src="Construct2/Images/Gnoll_Resting_smaller.gif" /&gt;'); }); }, function(){ $('.animateme').html('&lt;img src="Construct2/Images/Gnoll_Running_left.gif" /&gt;'); $('.animateme').animate({ left: '-=500', }, 2200, function() { $('.animateme').html('&lt;img src="Construct2/Images/Gnoll_Resting_smaller.gif" /&gt;'); }); }); $('#AddOnbutton').toggle(function(){ $('.animateme').html('&lt;img src="Construct2/Images/Gnoll_Running.gif" /&gt;'); $('.animateme').animate({ left: '+=250', }, 1000, function() { $('.animateme').html('&lt;img src="Construct2/Images/Gnoll_Hit.gif" /&gt;') }); $('.animateme').animate({ left: '+=0', }, 1000, function() { $('.animateme') .html('&lt;img src="Construct2/Images/Gnoll_Resting_smaller.gif" /&gt;'); }); }, function(){ $('.animateme').html('&lt;img src="Construct2/Images/Gnoll_Running_left.gif" /&gt;'); $('.animateme').animate({ left: '-=500', }, 2200, function() { $('.animateme').html('&lt;img src="Construct2/Images/Gnoll_Resting_smaller.gif" /&gt;'); }); }); }); &lt;/script&gt; </code></pre> <p>The problem is that I want the <strong>"#Homebutton"</strong> to change to red about halfway through the Gnoll_Hit animation. So I spliced the Hit animation but that didnt do it.</p> <p>I think I gotta do this with Callbacks because after the last animation is finished I want it to go to the buttons link.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload