As Kurt mentioned, this has to do with your image not being loaded
yet. Be sure to specify the height and width of the image or use
$(window).load(function(){});
--
Brandon Aaron
On 10/23/06, Truppe Steven <[EMAIL PROTECTED]> wrote:
> Hello again,
>
> i'm using the center plugin to center images inside a div. But i have to
> call it with a timeout like this:
>
> $(document).ready(function(){
> setTimeout("doCenter()",1000);
> });
>
> function doCenter(){
> $(".jqcenter").each(){
> $(this).center();
> }
> }
>
>
> I do not really understand why i need a timeout here because DOM should
> allready be ready inside of $(document).ready().
>
> The Problem with this is that it fails for some reason in certain cases,
> so that the image is misplaced. To me it looks like that in these cases
> the function is called to early because if i refresh the page it look fine.
>
> If i replace setTimeOut and call the function direct with doCenter() it
> does not work at all.
> Do i have a general understanding problem or what am i doing wrong ?
>
> best regards,
> Truppe Steven
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/