Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ,
i new to html, javascript. PLz help me out. i have to zoom image om mouse over without affeccting the other control on pages. just like this, plz check http://www.gorditosdecorazon.com/grid_productos/productos.htm[^]


Plz help
Posted

XML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Fancy Thumbnail Hover Effect w/ jQuery - by Soh Tanaka</title>
<style type="text/css">
body {
    font: Arial, Helvetica, sans-serif normal 10px;
    margin: 0; padding: 0;
}
* {margin: 0; padding: 0;}
img {border: none;}
.container {
    height: 360px;
    width: 910px;
    margin: -250px 0 0 -450px;
    top: 50%; left: 50%;
    position: absolute;
}
ul.thumb {
    float: left;
    list-style: none;
    margin: 0; padding: 10px;
    width: 360px;
}
ul.thumb li {
    margin: 0; padding: 5px;
    float: left;
    position: relative;
    width: 110px;
    height: 110px;
}
ul.thumb li img {
    width: 100px; height: 100px;
    border: 1px solid #ddd;
    padding: 5px;
    background: #f0f0f0;
    position: absolute;
    left: 0; top: 0;
    -ms-interpolation-mode: bicubic;
}
ul.thumb li img.hover {
    background:url(thumb_bg.png) no-repeat center center;
    border: none;
}
#main_view {
    float: left;
    padding: 9px 0;
    margin-left: -10px;
}
</style>
<script type="text/javascript" src="productos_archivos/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function(){

//Larger thumbnail preview

$("ul.thumb li").hover(function() {
    $(this).css({'z-index' : '10'});
    $(this).find('img').addClass("hover").stop()
        .animate({
            marginTop: '-110px',
            marginLeft: '-110px',
            top: '50%',
            left: '50%',
            width: '174px',
            height: '174px',
            padding: '20px'
        }, 200);

    } , function() {
    $(this).css({'z-index' : '0'});
    $(this).find('img').removeClass("hover").stop()
        .animate({
            marginTop: '0',
            marginLeft: '0',
            top: '0',
            left: '0',
            width: '100px',
            height: '100px',
            padding: '5px'
        }, 400);
});

//Swap Image on Click
    $("ul.thumb li a").click(function() {

        var mainImage = $(this).attr("href"); //Find Image Name
        $("#main_view img").attr({ src: mainImage });
        return false;
    });

});
</script>
<script src='/google_analytics_auto.js'></script></head>

<body>
<div class="container">
<ul class="thumb">
    <li style="z-index: 0;"><a href="productos_archivos/1.jpg"><img style="margin-top: 0px; margin-left: 0px; top: 0px; left: 0px; width: 100px; height: 100px; padding: 5px;" class="" src="productos_archivos/thumb1.jpg" alt=""></a></li>
    <li style="z-index: 0;"><a href="productos_archivos/2.jpg"><img style="overflow: hidden; margin-top: 0px; margin-left: 0px; top: 0px; left: 0px; width: 100px; height: 100px; padding: 5px;" class="" src="productos_archivos/thumb2.jpg" alt=""></a></li>
    <li style="z-index: 0;"></li>
    <li style="z-index: 0;"><a href="productos_archivos/3.jpg"><img style="overflow: hidden; margin-top: 0px; margin-left: 0px; top: 0px; left: 0px; width: 100px; height: 100px; padding: 5px;" class="" src="productos_archivos/thumb3.jpg" alt=""></a></li>
    <li style="z-index: 0;"><a href="productos_archivos/4.jpg"><img style="margin-top: 0px; margin-left: 0px; top: 0px; left: 0px; width: 100px; height: 100px; padding: 5px;" class="" src="productos_archivos/thumb4.jpg" alt=""></a></li>
</ul>
<div id="main_view"><a href="http://www.gorditosdecorazon.com/contactenos/fundacion/" title="Design Bombs - Web Gallery" target="_blank"><img src="productos_archivos/1.jpg" alt="" /></a><br>
</div>
</div>




</body></html>
 
Share this answer
 
Comments
Bhaskar Dhone 22-Feb-13 6:44am    
I got it..but i want on clicking that image it must take me to other link..plz help...
[no name] 22-Feb-13 6:51am    
make image as a link!!! you got your soln.
Bhaskar Dhone 22-Feb-13 7:01am    
Actually, there is funtion in script on click swap:
$("ul.thumb li a").click(function() {

var mainImage = $(this).attr("href"); //Find Image Name
$("#main_view img").attr({ src: mainImage });
return false;
});


In

<li style="z-index: 0;"><img style="overflow: hidden; margin-top: 0px; margin-left: 0px; top: 0px; left: 0px; width: 100px; height: 100px; padding: 5px;" class="" src="productos_archivos/thumb2.jpg" alt=""></li>


href i want say "http://www.google.com", if i gave , its not working....may be because of that onclick funtion..
Bhaskar Dhone 22-Feb-13 7:18am    
hey got that also thank you
[no name] 22-Feb-13 7:27am    
welcome
 
Share this answer
 
 
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