Jump to content

Make a thumbnail bigger while mouse hover


Recommended Posts

CSS3 has great way to do it. It's called transition. Here is a example how it would look:

 img {			transition:width 1s;			-moz-transition:width 1s;			-webkit-transition:width 1s;			-o-transition:width 1s;} img:hover {   width: 100%;}

Just remember! transition: [goal] [time]; Goal can be anything in CSS,background-color,color,height,float....etc. Time is in seconds! And the goal can't be in same CSS element,it must be in :after,:hover..etc.

Edited by Genert
Link to post
Share on other sites

Oh yeah,forgot to add that you can add multiple values.

img {					    transition:width 1s,height 1s;					    -moz-transition:width 1s,height 1s;					    -webkit-transition:width 1s,height 1s;					    -o-transition:width 1s,height 1s;}img:hover {   width: 100%;   height: 100%;}

Edited by Genert
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...