JengGe Chao
JengGe Chao

Reputation: 160

jquery.width() and jquery.height sometimes work wrong

I want to loop all img tags and put three 25*25 pixel images on the center on all images triangularly. Here is jsfiddle

And if you want to know how it works please check this url. http://tag-test-super-star.c9users.io

This sometimes work correctly but sometimes work wrong. Please help me.

Upvotes: 2

Views: 250

Answers (1)

user5683130
user5683130

Reputation:

You have to wait until the images are loaded.

jQuery(window).load(function(){
    //some code
})

Upvotes: 2

Related Questions