0 Favourites

jQuery anyone?

  • I couldn't get C2 to look propperly as a Navigation Bar on my Website.

    So now I am learning a .js and a bit jQuery.

    I Kinda just ripped an existing script and now I am trying to make it work for me:

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript">

       $(document).ready(function(){

       $('dota').click(function(){

        

         });

            $('#Homebutton').toggle(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') .html('<img src="Construct2/Images/Gnoll_Resting_smaller.gif" />');

                        

                        

                });

            }, function(){

                $('.animateme').html('<img src="Construct2/Images/Gnoll_Running_left.gif" />');

                $('.animateme').animate({

                   left: '-=500',

                }, 2200, function() {

                   $('.animateme').html('<img src="Construct2/Images/Gnoll_Resting_smaller.gif" />');

                });

            });

              

              

        });

    </script>

    The script makes the "Gnoll" Move

    But the

    $('.animateme').html('<img src="Construct2/Images/Gnoll_Hit.gif" />')

    Is supposed to come before the "Resting" Animation...

    .delay(2000) didn't work for me.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • vailla-guides.com for the tiny animation

  • The Scirra forums is not the best place to ask programming questions. Can I recommend StackOverflow?

  • Already posted there :p

    Just doubling my chances lol.. sorry^^

  • OK, closing this thread - best take it up on StackOverflow.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
66 8,893
Reflextions's avatar
Reflextions
Unread hot topic
0 Favourites
Anyone up for Ludum Dare?
42 5,751
DrewMelton's avatar
DrewMelton
Unread hot topic
38 2,324
99Instances2Go's avatar
99Instances2Go