javascript - Hiding a DIV in a JQuery Overlay Window -
taking code found here: http://jquerytools.org/demos/overlay/external.html
i got popup window work , wanted prevent header displaying in overlay popup window. i've added $('#header').hide(); script below not working. sorry im not familiar javascript. great!
$(function () { // if function argument given overlay, // assumed onbeforeload event listener $("a[rel]").overlay({ mask: 'grey', effect: 'apple', onbeforeload: function () { // grab wrapper element inside content var wrap = this.getoverlay().find(".contentwrap"); // load page specified in trigger wrap.load(this.gettrigger().attr("href")); $('#header').hide(); } }); });
i did quick test, , think issue you're trying hide header before renders on page. overlay configuration has event called onload, better place ensure loading of external content has happened.
try code:
$(function() { // if function argument given overlay, // assumed onbeforeload event listener $("a[rel]").overlay({ mask: 'grey', effect: 'apple', onbeforeload: function() { // grab wrapper element inside content var wrap = this.getoverlay().find(".contentwrap"); // load page specified in trigger wrap.load(this.gettrigger().attr("href")); //at point, page still loading external content, it's not available hide yet }, onload: function() { $('#header').hide(); } }); });
Comments
Post a Comment