...

View Full Version : content loading at bottom, repositions to top once loaded



amamfda
01-22-2009, 07:24 PM
Hi,

I'm building a simple portfolio gallery and am having trouble determining why the content is loading at the bottom of the page and then "jumping" into place once all images are loaded. This occurs in all browsers I tested on both the Mac and PC which were Mac - Firefox 3.0.5, Safari 3.2.1, Opera 9.6.3. PC-IE 6 and 7, Firefox 3.0.5, and Opera 9.27. I'm new to JavaScript and new to using unordered lists in CSS. Any help is greatly appreciated.

Here's the link to the sample page:

http://www.royaltin.com/MZ09/marla/recent.html

Thank you for any guidance you can provide.

freedom_razor
01-23-2009, 10:47 AM
In this part of the code of your page:


<script type="text/javascript">document.write("<style type='text/css'> #gallery { display: none; } </style>");

<!--[if lt IE 6]>
<style media="screen,projection" type="text/css">
#gallery { display: block; }</style><![endif]-->
</script>


remove IE conditional comment out of the <SCRIPT> tag and see it that works for you, like this:


<script type="text/javascript">document.write("<style type='text/css'> #gallery { display: none; } </style>");
</script>
<!--[if lt IE 6]>
<style media="screen,projection" type="text/css">
#gallery { display: block; }</style><![endif]-->

amamfda
01-23-2009, 09:33 PM
Awesome. Thanks very much for the suggestion. I actually re-worked the whole layout yesterday and got rid of margins in the ul and that fixed everything. Thanks for taking the time to look at my code. Much appreciated.

results are here:

http://royaltin.com/MZ09/marla/recent.html

freedom_razor
01-24-2009, 10:04 AM
Margins weren't the problem, the conditional comment in its original form was :) It was inside the script tag, and wasn't really counting as a comment, applying DISPLAY:BLOCK to your #gallery not only in IE6 [overwriting previous DISPLAY:NONE]. If you write it as it was, your gallery now appears on the left and then jumps to its position when its fully loaded.
Anyway, glad everything works, and I also learned something :) [didn't know that you can put STYLE tag inside SCRIPT and it is going to be parsed and applied while throwing an error, at least in FF].



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum