Click here to Skip to main content
15,747,766 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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="#">


<img src="bluespinner.gif" border="0" />


<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';

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.
Share this answer
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...

Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900