Web Programming Training By OM SIR Call for free Demo :9320957717/18

zoom in & zoom out javascript code onMouseover & onMouesout example

(24)zoom in & zoom out  javascript code onMouseover & onMouesout example:

<html>
<BODY>
<script>
var nW,nH,oH,oW;
function zoomToggle(iWideSmall,iHighSmall,iWideLarge,iHighLarge,whichImage)
{
oW=whichImage.style.width;oH=whichImage.style.height;
if((oW==iWideLarge)||(oH==iHighLarge))
    {

    nW=iWideSmall;
    nH=iHighSmall;
    }
else
    {

    nW=iWideLarge;
    nH=iHighLarge;
    }

whichImage.style.width=nW;
whichImage.style.height=nH;
}
</script>
<table >
 <tr>
 <td >       
 <img border="0"  src="1.png" width="100" height="100"onMouseOut="zoomToggle('100px','100px','200px','200px',this);" onMouseOver="zoomToggle('300px','300px','400px','400px',this);">
 <br>
 </td>
 </tr>
 </table>
</body>
</html>

(25)Gallery  Code example in  Javascript :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Simple Photo Gallery with HTML and JavaScript</title>

<style type="text/css">
body {
background: #222;
margin: 0;
}
.thumbnails img {
height: 80px;
border: 4px solid #555;
padding: 1px;
margin: 0 10px 10px 0;
}

.thumbnails img:hover {
border: 4px solid #00ccff;
cursor:pointer;
}

.preview img {
border: 4px solid #444;
padding: 1px;
width: 800px;
}
</style>
</head>

<body>
<div class="gallery" align="center">
<h3>Simple HTML Photo Gallery with JavaScript</h3>

<div class="thumbnails">
<img onmouseover="preview.src=img1.src" name="img1" src="1.png" alt="" />
<img onmouseover="preview.src=img2.src" name="img2" src="php_img.png" alt="" />
<img onmouseover="preview.src=img3.src" name="img3" src="2.jpg" alt="" />
<img onmouseover="preview.src=img4.src" name="img4" src="images/img4.jpg" alt="" />
<img onmouseover="preview.src=img5.src" name="img5" src="images/img5.jpg" alt="" />
</div>
<div class="preview" align="center">
<img name="preview" src="1.png" alt=""/>
</div>

</div> <!-- Close the gallery div -->
</body>
</html>
Previous
Next Post »