Is it possible to prevent shadowbox from automatically resizing?

3 messages Options
Embed this post
Permalink
Josh

Is it possible to prevent shadowbox from automatically resizing?

Reply Threaded More More options
Print post
Permalink
I have tried: handleOversize: "none"

But to no avail, and I'm not even sure if that was the intended purpose of handlerOversize.

Shadowbox automatically resizes the viewport as the user resizes their browser, adding scrollbars to the viewport.

I would rather they used the browser's scroll bars and the viewport never changed size. Is this possible?

Thanks!
Wizzud

Re: Is it possible to prevent shadowbox from automatically resizing?

Reply Threaded More More options
Print post
Permalink
No
Combine literacy with curiosity and a whole world of information opens up to you
MoKeS

Re: Is it possible to prevent shadowbox from automatically resizing?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Josh
Hello,

I had the same issue but I found a solution...

For my project, I must use the browser's scrollbar instead of shadowbox's. So I edit the shadowbox.js but not dynamicly...

You have to change the adjustHeight function.  ( Line 1876). The first thing si to give a sb.style.height which is not dynamic.
In my case, i wrote : sb.style.height = '1024px';
This line prevents the shadowbox to resize its height automatically.

Then you need to change the top of the SB. When my scroll bar is on top, my shadowbox has a 15 px padding-top. But you can change that value has you want. And, when you will scroll, the SB should stay at the same place. To do that, you should calculate the right padding top.

I first create a variable :

var scrollHeight = window.pageYOffset ||
           document.body.scrollTop ||
           document.documentElement.scrollTop;

This var will be the distance between the top and the scroll position. Then i will use the "t" variable from the adjustHeight function, and calculate the right style.top

==> t = 15 - scrollHeight ;

Now, when you will resize your window, the sb will be at the right place, without scrollbars.
But, we would that the sb will be at the same place when we scroll... so i just add a little javascript function under the adjustHeight function.

==> window.onscroll = function() {adjustHeight()};

And now, it works... :-).
When you scroll your window, the sb does'nt move and you can see all you iframe, or sb content by scrolling the main window.


MoKeS