[jQuery] function: toggleslide
<div>hi all,
for some reason.. the first thing i add to these
types of scripts is (ie: i did this for my scriptaculous and prototype
implementation) :
toggle + slide = toggleslide !
am i the only nut who keeps seeing a use for this?
i usually just combine both functions to form the one (since i happen to use this effect often).
for jQuery it goes a little something like this:
---------------------------
toggleslide: function() {
return this.each(function(){
var d = $.getCSS(this,"display");
if ( d == "none" || d == '' )
$(this).slideDown("fast");
else
$(this).slideUp("fast");
});
},
---------------------------
i put it just after the regular "toggle" function in
jquery.js and presto.
tested with the uncompressed Dev version of jQuery [ Rev: 88 ]
not sure how to add it as a plugin though.. (ie: in a separate js file)
it's madness i tell you!
</div><span>
Elran</span>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/