Posted By

ivorpad on 07/14/10


Tagged

plugin jquery fadeToggle


Versions (?)

fadeToggle - 3 lines - jQuery Plugin


 / Published in: JavaScript
 

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

  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. });

Report this snippet  

You need to login to post a comment.