Title: [Plugin: Shadowbox JS] Passing options in setup
Last modified: August 20, 2016

---

# [Plugin: Shadowbox JS] Passing options in setup

 *  [Parakoos](https://wordpress.org/support/users/parakoos/)
 * (@parakoos)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-shadowbox-js-passing-options-in-setup/)
 * Hello. I am trying to get Shadowbox to work with iphones etc, and I am trying
   to implement [this hack](http://shadowbox-js.1309102.n2.nabble.com/IPad-safari-browser-td4713039.html).
   But, it required me to pass a couple of options in init, which I can’t modify
   when using the wordpress plugin.
 * So I thought that I could delay the setup and then pass in the options there,
   but alas, no luck. I don’t think I am getting the link selector in the setup 
   call right though.
 * If I call the following it works fine
 * `
    window.onload = function() { Shadowbox.setup(); };
 * But when I call this, none of the links are set up.
 * `
    window.onload = function() { Shadowbox.setup('a[rel="shadowbox"]',{ handleOversize:"
   resize", onOpen: function() { if((navigator.userAgent.match(/iPhone/i))||(navigator.
   userAgent.match(/iPad/i))) { $("#sb-container").css("top", $(window).scrollTop());
   $(window).bind('scroll', function() { $("#sb-container").css("top", $(window).
   scrollTop()); }); } }, onClose: function() { if((navigator.userAgent.match(/iPhone/
   i))||(navigator.userAgent.match(/iPad/i))) { $(window).unbind('scroll'); } } });};
   Can someone please help me out with getting this hack in place?
 * Many thanks.
 * Gustav
 * [http://wordpress.org/extend/plugins/shadowbox-js/](http://wordpress.org/extend/plugins/shadowbox-js/)

The topic ‘[Plugin: Shadowbox JS] Passing options in setup’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shadowbox-js.svg)
 * [Shadowbox JS](https://wordpress.org/plugins/shadowbox-js/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shadowbox-js/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shadowbox-js/)
 * [Active Topics](https://wordpress.org/support/plugin/shadowbox-js/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shadowbox-js/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shadowbox-js/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Parakoos](https://wordpress.org/support/users/parakoos/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-shadowbox-js-passing-options-in-setup/)
 * Status: not resolved