I was making a small effect of sliding up and sliding down. It will toggle on every click to a single link/button. I was first planning to make the toggle code myself and taking help of slideUp() and slideDown() functions of jquery. But, Very soon, i came to know about the new function of jquery slideToggle() that actually do my requirements automatically. As a result i got my job done in a single line of code:
$("#linkId").click(function(){
$("#divId").slideToggle().
});
There are details documentation and options on jquery's main documentation site. Find reference of this funciton here:
jquery toggle slide
Moreover what i liked about this function, its works and shows a div automatically if its hidden initially(i needed that as on page loading a div is shown until script execution).
Subscribe to:
Post Comments (Atom)










0 comments:
Post a Comment