tags:

views:

283

answers:

1

Hello,

I've an issue at the first load of a page with outerHeight.

The value returned by outerHeight() is a multiple of 27.

jQuery

$('.entries').each(function(r) {    
$(this).attr("value", $(this).outerHeight()+15);
})

HTML :

<div class="entries">
 <div class="container_entrie">
 <span class="meta"><span class="title">Daily Inspiration #128</span> 
   <span class="date">- april 10th 2009 </span></span>   
 <img src="images/content/four.png" />
 </div>
</div>

CSS :

.entries {  
position:absolute;  
overflow:hidden;
cursor:pointer;
width:200px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
padding:6px;
background-color:#171717;   
}

.meta{ 
position:absolute; 
bottom:0; float:left; width:190px; padding-top:5px; padding-bottom:5px; padding-left:5px; padding-right:5px;  font-size:11px; font-weight:bold; line-height:14px;
background-color:#000; 
/* for IE */
filter:alpha(opacity=70);
/* CSS3 standard */
opacity:0.7;
border-top:1px solid #000;
}     
.meta span.title{color:#FFF; }
.meta span.date{color:#999999; font-weight:normal;}
.container_entrie{position:relative; width:200px; float:left; overflow:hidden; }

And one all is loaded, after a refresh everithing is fine.

So I'm wondering if it's not an issue about the images in container_entrie ?

Thanks for the help =)

A: 

Where is your javascript being called from? Unless you set a height on your image, you'll have issues if you're putting it in $(...) (the shorthand for $(document).ready). Try putting it in $(window).load(...) and see if that helps. Load fires after all content is downloaded, Ready is a pseudo event that fires when the dom is ready to be messed with.

Dan F
Thanks Dan but It dosen't seem to fix the problem.
adrien334
but it's working when I add width/height on pictures. =)Thanks
adrien334
Awesome, glad it helped
Dan F