I have a question about good manners with image manipulation.
I know three ways to do that, so I want know what is best (if anyone has some better way, be my guest in posting), using click’s, mouseover’s, doubleclick’s and other events.
-
make a background and change the background position. ( this is what i use most )
-
change the
attr("src") -
work with imagem aready loaded but with hidden mode. ( this in my point of view is terrible )
Now I’m working with a lot of image manipulation, so I want to start doing the right thing.
what is the best way to manipulate image’s using jquery ?
Thanks.
Your first method is also called using sprites. http://www.alistapart.com/articles/sprites Actually, the most efficient method is to place many icon sized images into one big ‘sprite’ image and just change the background image because:
There are tools available that automate this entire process for you.
Compass is my favourite: http://compass-style.org/help/tutorials/spriting/