jQuery.fn.slideFadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); }; jQuery.fn.blindToggle = function(speed, easing, callback) { var h = this.height() + parseInt(this.css('paddingTop')) + parseInt(this.css('paddingBottom')); return this.animate({marginTop: parseInt(this.css('marginTop')) <0 ? 0 : -h}, speed, easing, callback); }; $(document).ready(function(){ $(".btn-slide1").click(function(){ $("#productpopup").slideFadeToggle("slow"); return false; }); }); $(document).ready(function(){ $(".btn-slide2").click(function(){ $("#applicationpopup").slideFadeToggle("slow"); return false; }); }); /* $(document).ready(function() { var $box = $('#productpopup').wrap('
'); $('.btn-slide2').click(function() { $box.blindToggle('slow'); }); }); */