jQuery anyone?

Chat about anything not covered in these forums, but keep it civil!

Post » Wed Jul 04, 2012 4:05 pm

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.
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Wed Jul 04, 2012 4:05 pm

vailla-guides.com for the tiny animation
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Thu Jul 05, 2012 12:10 am

The Scirra forums is not the best place to ask programming questions. Can I recommend StackOverflow?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Thu Jul 05, 2012 4:53 am

Already posted there :p

Just doubling my chances lol.. sorry^^
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Thu Jul 05, 2012 12:50 pm

OK, closing this thread - best take it up on StackOverflow.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478


Return to Open Topic

Who is online

Users browsing this forum: No registered users and 4 guests