View Single Post
Old 12-03-2012, 03:17 PM   PM User | #2
coothead
Senior Coder

 
coothead's Avatar
 
Join Date: Jan 2004
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 1,551
Thanks: 0
Thanked 195 Times in 191 Posts
coothead will become famous soon enough
Hi there Ax3l,

no need for javascript, CSS will do the trick.

Here is a basic example...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>

<base href="http://www.coothead.co.uk/images/">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="english"> 
<meta http-equiv="Content-Style-Type" content="text/css">

<title></title>

<style type="text/css">
body {
    background-color:#f0f0f0;
 }
#image0 {
    display:block;
    width:100px;
    height:100px;
    padding:20px;
    margin:auto;
    border:1px solid transparent;
    cursor:pointer;
 }
#image0:hover {
    border-color:#909;
    background-image:url(anim2.gif);
    background-position:center center;
    box-shadow:4px 4px 4px #999;
 }
</style>

</head>
<body>

<div>
 <img id="image0" src="anim1.gif" alt="">
</div>

</body>
</html>
coothead
coothead is offline   Reply With Quote