Stop shadowbox from resizing

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Stop shadowbox from resizing

Jason
I am using the following code to open an iframe:

$('a.load_note').click(function(){
        Shadowbox.open({
                content: "blah.html",
                player: "iframe",
                title: "Note",
                height: 700,
                width: 740,
                options: { handleOversize: "none" }
        });
        return false;
});

This works fine, however if I resize my browser the shadowbox window resizes. I want it to stay at 740x700 any ideas?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Stop shadowbox from resizing

Daniel Skantze
One solution would be to set a min-width (and possibly a min-height as well) on the sb-container. Do something like this shadowbox.css for example:

#sb-container{position:fixed;margin:0;padding:0;top:0;left:0;z-index:999;text-align:left;visibility:hidden;display:none; min-width: 1000px; }

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Stop shadowbox from resizing

Josh McJohnnyBarPopNFizzBobALickAla
In fact, the bloc to apply a min width is : #sb-wrapper

If you want to prevent horizontalScroll and if you know your final box width you can use this in css :

#sb-wrapper{
position:absolute;
visibility:hidden;
width:680px!important;
left:50%!important;
margin-left:-340px!important;
}

If you don't know them you can apply JS to resize the box modifying manually those values.

Kisses n else
Josh McJohnnyBar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Stop shadowbox from resizing

Sloflo
Rookies!

here you go.  Just add this as a callback function after opening a shadowbox

       $(window).unbind("resize");
        $(window).bind("resize", function(){
        var initW = $(window).width();
        var initH = $(window).height();
        var initWH = parseFloat($("#sb-wrapper-inner").css("height"));
        var initWW = parseFloat($("#sb-wrapper").css("width"));
        var calcLM = (initW - initWW) / 2;
    var calcTM = (initH - initWH) / 2;
    $("#sb-wrapper").css("left", calcLM+"px");
        $("#sb-wrapper").css("top", calcTM+"px");
        $("#sb-container").css("width", $(window).width()+"px");
        $("#sb-container").css("height", $(window).height()+"px");
        });


Sometimes the best answer is the easiest one
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Stop shadowbox from resizing

arttronics
For those that land on this page, a reply to this method by SloFlo if found HERE in the other thread.

When posting your markup here on the forum follow these simple steps:

0. Login and paste your markup into the Message Box.
1. Mouse select the markup you just pasted.
2. Press the More Button from the Message Box Toolbar.
3. Select Raw text from the drop down menu. DONE!

If I don't respond to your POST, it's your inability to provide your markup correctly.

Check out a few DEMOS I made that are here in this forum.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Stop shadowbox from resizing

Gabriel De Ioannes Becker
In reply to this post by Jason
Just put this in the init

Shadowbox.init({
    viewportPadding:-1000
});
Then the pading never gets to negative and so does't resize.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Stop shadowbox from resizing

Aura
In reply to this post by Josh McJohnnyBarPopNFizzBobALickAla
Thank you, Josh! Your solution worked wonderfully for me! Perfect!!!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Stop shadowbox from resizing

Rolandcharcker
In reply to this post by Jason
You can try force it to the height you want by putting this in the shadowbox.css file. For more writing help you can click this.
Loading...