First the original picture is a big picture,
<div id= "_images" style= border: #000 1px solid;overfow:hidden;width:100px;height:100px "></div>
1. The small figure is located in the Div, with style=overfow:hidden;width:100px;height:100px;
To limit the display size of the picture, only shown as high width 100px
<div id= "Enlarge_images" style= "Position:absolute; Z-index:2; Display:none; " ></div>
2. Used to show the div,style=display:none of the large picture, which is the original size; let it not show first
<SCRIPT>
Function Show (_this) {
document.getElementById ("Enlarge_images"). InnerHTML = "<div></div>";
Move_layer (event); Where to appear when displayed
}
Hover the mouse over the small picture, display with enlarge_images layer
function Hide (_this) {
document.getElementById ("Enlarge_images"). InnerHTML = ""; document.getElementById ("Enlarge_images"). style.display= "None";
}
Mouse left, enlarge_images layer does not show
function Move_layer (_event) {
document.getElementById ("Enlarge_images"). Style.left=_event.x;
document.getElementById ("Enlarge_images"). Style.top=_event.y;
}
</SCRIPT>
If it's two pictures, change it here.
Function Show (_this) {
document.getElementById ("Enlarge_images"). style.display= "";
document.getElementById ("Enlarge_images"). InnerHTML = "<div></div>"; _this.src to a large picture of SRC
Move_layer (event); Where to appear when displayed
}
For example, the small map src is 15.jpg, the large map address should be set to regular, such as 15_large.jpg, change the function
Function Show (_this) {
var _src = _this.src.replace (/\./ig, "_large.");
document.getElementById ("Enlarge_images"). style.display= "";
document.getElementById ("Enlarge_images"). InnerHTML = "<div></div>";
Move_layer (event);
}
}
document.getElementById ("Enlarge_images"). style.display= "";
The regular expression here is simple, putting the "." In the 15.jpg. Replace with "_large." You get 15_large.jpg.