View Single Post
Old 02-01-2013, 05:06 PM   PM User | #3
paffley
New Coder

 
Join Date: Sep 2010
Posts: 86
Thanks: 24
Thanked 0 Times in 0 Posts
paffley is an unknown quantity at this point
Hi Sunfighter,

Thanks for the heads up...

The code works fine when the browser is restored down, but not when it hits 800px...

this is what happens...
lets say I have at full screen, the #object is at the natural position, then when I restore down the browser window width, the #object moves to -100px no matter what the window size width is.

I need it to only move position when the browser window is restored down to 800px width.

then also, for it to move back to its natural position if the browser window is more than 800px width.


Hope I've explained correctly


This is the code ive been using for the #object to hide/show depending on browser window width (this works fine for show/hide)...

Code:
    $(function() { 
        $(window).bind("resize", function() { 
            $('#object').toggle($(this).width() >= 800);   
        }).trigger("resize"); 
    });



Kind regards,
paffley

Last edited by paffley; 02-01-2013 at 05:10 PM.. Reason: more info
paffley is offline   Reply With Quote