Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old April 10th, 2008, 06:51 AM   #1
New Member
 

Join Date: Oct 2007
Location: UK
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 djeyewater is on a distinguished road
div resizing problem

I am having a problem where I resize a div relative to the page size, when you resize the window the div should resize to fit the page. It works okay when you make the page longer, but if you make the page shorter it doesn't work.

Please have a look at this example to see what I mean: http://www.brighton360.com/index.php.html
(Problem occurs in Opera & FF). Click on one of the images, (click OK on alert) resize the window so that it is really thin (click OK on alert). Now resize the window back to fullscreen. I added some debugging code, an alert pops up and you can see that the overlay div has resized to 1px - but look at the scrollbar - its the same as when the window was small. Click okay on the alert and the div resizes to fit the page - which is the same height as it was when the window was small. So you're left with a massive blank section at the bottom of the page.

Please could anyone help me with this, I don't understand why the page is staying so long when it doesn't have any content to make it that long (at the point the div height is set to 1px).

This problem can be fixed by setting the div to display = none before recalculating page size, but I don't really like this fix. Why setting display = none doesn't have the same effect as changing the size to 1px high I don't know.
djeyewater is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 10th, 2008, 03:56 PM   #2
New Member
 

Join Date: Oct 2007
Location: UK
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 djeyewater is on a distinguished road
Re: div resizing problem

Solved - Setting the height and width of the div to the page size rather than setting minHeight and minWidth seems to fix it. Still, would be interested if anyone knows why it didn't work.
djeyewater is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help resizing images philhxc PHP 2 July 16th, 2007 01:08 AM
Firefox image resizing problem with CSS paishin HTML, XHTML and CSS 2 June 15th, 2007 10:29 AM
Resizing Photos McAurthur19 Flash and ActionScript 4 May 3rd, 2007 12:13 AM
resizing.... jjgamepro17 HTML, XHTML and CSS 3 April 18th, 2007 05:22 PM
Resizing (in pixels) danburzo Graphic Specifics 2 June 19th, 2005 08:06 AM


Search Engine Optimization by vBSEO 3.2.0 RC8