Friday, 15 July 2011

javascript - Image size with percentage slows down site -



javascript - Image size with percentage slows down site -

a bit wired problem. have jquery animations , many other events work when in css file image width , height given in pixels when set them in percentage or auto (height: 100%; width: auto; --> how need be), whole web site slows down. events don't trigger right away , animations aren't smooth @ (i see 2 or 3 frames of animations). ideas might problem or how can fixed ?

example of animations(left , right divs):

$("#left").animate({"width":"+=15%"},"linear"); $("#right").animate({"width":"+=15%"},"linear");

css:

img { height: 100%; width: auto; }

whenever have had site performance issues when using animations have involved images beingness large. you're using percentage sizing, may not obvious images much larger need be.

the average desktop screen size 1366×768, meaning websites, maximum image width/height should 1366/768 full-screen galleries (obviously less if these images acting icons/thumbnails).

inspect images' native dimensions in developers panel, , create sure don't exceed these dimensions: may solve performance issues.

javascript jquery html css

No comments:

Post a Comment