{"id":1611,"date":"2011-03-23T12:36:23","date_gmt":"2011-03-23T11:36:23","guid":{"rendered":"http:\/\/www.maratz.com\/blog\/?p=1611"},"modified":"2011-05-19T11:23:56","modified_gmt":"2011-05-19T10:23:56","slug":"hide-flash-banners-when-launching-fancybox-modal","status":"publish","type":"post","link":"https:\/\/www.maratz.com\/blog\/archives\/2011\/03\/23\/hide-flash-banners-when-launching-fancybox-modal\/","title":{"rendered":"Hide Flash banners when launching Fancybox modal"},"content":{"rendered":"<p>When launching image modal with <a href=\"http:\/\/fancybox.net\/\">Fancybox<\/a>, Flash banners delivered from a third-party ad server could take over the top layer, covering the portion of the enlarged image. <\/p>\n<p>The workaround is easy, but it\u2019s not well documented. It\u2019s done by Fancybox\u2019s own callback options.<\/p>\n<p><code><\/p>\n<pre>\r\n$('a[href$=\".jpg\"]').fancybox({ \r\n    onStart: function() { $('.banner object, .banner embed').hide(); }, \r\n    onClosed: function() { $('.banner object, .banner embed').show(); }\r\n});\r\n<\/pre>\n<p><\/code>   <\/p>\n<p>Other <a href=\"http:\/\/fancybox.net\/api\">Fancybox callback options<\/a>:<br \/>\n<code>onStart<\/code>, <code>onCancel<\/code>, <code>onComplete<\/code>, <code>onCleanup<\/code> and <code>onClosed<\/code>.<\/p>\n<p>See it in action at <a href=\"http:\/\/www.gadgeterija.net\/\">Gadgeterija.net<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When launching image modal with Fancybox, Flash banners delivered from a third-party ad server could take over the top layer, covering the portion of the enlarged image. The workaround is easy, but it\u2019s not well documented. It\u2019s done by Fancybox\u2019s own callback options. $(&#8216;a[href$=&#8221;.jpg&#8221;]&#8217;).fancybox({ onStart: function() { $(&#8216;.banner object, .banner embed&#8217;).hide(); }, onClosed: function() { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[70],"_links":{"self":[{"href":"https:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/posts\/1611"}],"collection":[{"href":"https:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/comments?post=1611"}],"version-history":[{"count":0,"href":"https:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/posts\/1611\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/media?parent=1611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/categories?post=1611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/tags?post=1611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}