jquery - .click .animate .toggle combining two things into one button -


i'd appreciate advice.

i'd combine 2 functions on 1 button.

i've written makes button move or down when clicked. i'd use button toggle text appear. have javascript both done don't know how combine black circle 1 button.

i put code on jsbin please take look!

http://jsbin.com/avuruz/235/edit

also
don't know why black circle goes crazy @ start.
circle should go first down , forth. first 2 clicks goes up, up.

$(function(){ var c=0; $(".click").click(function(){     $(this).stop().animate({top: ++c%2*100 }, 'fast'); });   

});

thanks

simply bind both function .click

http://jsbin.com/avuruz/240/edit


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -