Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: HTML
Hello sir,
i have one image, in this image there is different logos , so iam catching through pixcels but ineed when my mouse is hover on that particular pixcels image should be zoom out and when he clicks he should navigate to particular link
can you give e idea which helps me
below is the code iam using what i have to change can any body help me

<title>Main Page</title>
<body >
<img src="NewEmsC.jpg" usemap="#CheckCompany" border="0"
style="width: 1280px; height: 984px">
<map name="Branches">
<area shape="rect" coords="1026,10,1263,346" id="1"
önclick="ShowSpinner(; return(false);" href="#" border="0">
<area shape="rect" coords="770,9,1009,345" id="2"
önclick="ShowSpinner(; return(false);" href="#">
<area shape="rect" coords="517,10,754,343" id="3"
önclick="ShowSpinner(; return(false);" href="#">


<script language="JavaScript">
function ShowSpinner(id)
if (id == 1)
window.location = "";
else if (id == 2)
window.location = "";
else if (id == 3)
window.location = "";


document.getElementById('spinner').style.display = 'block';
function HideSpinner() {
var state = document.getElementById('spinner').style.display;
document.getElementById('spinner').style.display = 'none';
Posted 15-Jan-13 23:27pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Many basic jQuery plugins are available if googled properly.
Here is basic javascript code for image zoom
function resImg(image){
        var resize = 200; // amount in percentage
        var oldheight  = 150;  // height of your image
        var oldwidth  = 250; // width of your image
        var X = event.x;
        var Y = event.y;
        var newHeight   = oldheight * (resize / 100);
        var newWidth   = oldwidth * (resize / 100);
 = newHeight;//height of new image  = newWidth;// width of new image

        var c = image.parentNode;
        c.scrollLeft = (X * (resize / 100)) - (newWidth / 2) / 2; //this is for 
        c.scrollTop  = (Y * (resize / 100)) - (newHeight / 2) / 2;//new center
you can call this function on the onmouseover Event of the image
like this:
<img src="NewEmsC.jpg" usemap="#CheckCompany" border="0"  önmouseover="resImg(this)" style="width: 1280px; height: 984px">
you are using area tag which shows the image by the coordinates so you have to pass the image in order to zoom.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Looking at the code, the onmouseover event calls a showtrail function from the js file here
Parameters: showtrail(imagename,title,description,ratingaverag e,ratingnumber,showthumb,height)
<script language="javascript" src="/filesearchhover.js" type="text/javascript"></script>
onmouseover="showtrail('','Dirty metal grate','Dirty metal grate','3.0000','0','1',203);"
That might work, give it try...
Smile | :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid