fadeToggle - 3 lines - jQuery Plugin


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //Set the fadeToggle function
  2. $.fn.fadeToggle = function(speed) {
  3. return this.animate({opacity: 'toggle'}, speed);
  4. };
  5.  
  6. //Execute the plugin
  7. $('div#workContent').hide();
  8. $("a.allContent").click(function(){
  9. $("div#workContent").fadeToggle(150);
  10. $(this).toggleClass("active");
  11. return false;
  12. });
  13. $("a.closecontent").click(function () {
  14. $("div#workContent").fadeToggle(150);
  15. return false;
  16. });

URL: http://groups.google.com/group/jquery-en/tree/browse_frm/thread/bd9ab1487def3fc8/a24286723ec3ab98?rnum=1&_done=/group/jquery-en/browse_frm/thread/bd9ab1487def3fc8?&pli=1

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.