.click .animate .toggle combining two things into one button
I'd really appreciate your advice.
I'd like to combine two functions together on one button.
i've written something that makes a button move up or down when clicked.
However I'd like to use that as a button to toggle some text to appear. I
have the javascript for both done but I don't know how to combine it so
that black circle is the one button.
I put all the code on jsbin Please take a look!
http://jsbin.com/avuruz/235/edit
ALSO
i don't know why the black circle goes crazy at the start.
The circle should go first DOWN then UP and so forth. but for the first
two clicks it goes UP, UP.
$(function(){
var c=0;
$(".click").click(function(){
$(this).stop().animate({top: ++c%2*100 }, 'fast');
});
});
thanks
No comments:
Post a Comment