Click here to Skip to main content
15,881,882 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


<head>
<title>Main Page</title>
</head>
<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(this.id); return(false);" href="#" border="0">
<area shape="rect" coords="770,9,1009,345" id="2"
önclick="ShowSpinner(this.id); return(false);" href="#">
<area shape="rect" coords="517,10,754,343" id="3"
önclick="ShowSpinner(this.id); return(false);" href="#">


</map>



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



</body>
</html>

<script language="JavaScript">
function ShowSpinner(id)
{
if (id == 1)
{
window.location = "http://www.yahoomail.com";
}
else if (id == 2)
{
window.location = "http://www.google.com";
}
else if (id == 3)
{
window.location = "http://www.windowslive.com";
}




document.getElementById('spinner').style.display = 'block';
}
function HideSpinner() {
var state = document.getElementById('spinner').style.display;
document.getElementById('spinner').style.display = 'none';
}
</script>
Posted

Many basic jQuery plugins are available if googled properly.
Here is basic javascript code for image zoom

JavaScript
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);

        image.style.height = newHeight;//height of new image
        image.style.width  = 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:
HTML
<img src="NewEmsC.jpg" usemap="#CheckCompany" border="0"  önmouseover="resImg(this)" style="width: 1280px; height: 984px">

Remember,
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
 
v2
XML
Looking at the code, the onmouseover event calls a showtrail function from the js file here http://www.istockphoto.com/filesearchhover.js

Parameters: showtrail(imagename,title,description,ratingaverag e,ratingnumber,showthumb,height)

Example:

<script language="javascript" src="/filesearchhover.js" type="text/javascript"></script>

onmouseover="showtrail('http://www.istockphoto.com/file_thumbview_approve/64097/2/istockphoto_64097_dirty_metal_grate.jpg','Dirty metal grate','Dirty metal grate','3.0000','0','1',203);"

onmouseout="hidetrail();"

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