[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. 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
The topic ‘[Plugin: Shadowbox JS] Passing options in setup’ is closed to new replies.