<! DOCTYPE html>
<meta charset= "UTF-8" >
<title></title>
<style>
body,p,h1,h2,h3,h4,h5,h6,dl,dd,li{margin:0}
ol,ul{list-style:none;padding:0;margin:0}
A{text-decoration:none;}
Img{border:none;}
. Img-panel li{
Position:absolute;
/*display:inline-block;*/
width:90px;
height:120px;
BORDER:3PX #d9d9d9 Solid;
Z-index:10;
}
. Img-panel img{
Display:inline;
width:100%;
height:100%;
}
</style>
<body>
<div class= "Content" >
</div>
<script type= "Text/javascript" src= "Http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js" ></script>
<script type= "Text/javascript" >
$. Imagepanel = function (options) {
var _options={
Depend: ". Content",
IMG_MIN_HEIGHT:120,
IMG_MAX_HEIGHT:200,
Img_min_width:90,
img_max_width:150,
Cols:3,
img_list:["Onepiece.jpg", "onepiece.jpg", "onepiece.jpg", "onepiece.jpg", "onepiece.jpg", "onepiece.jpg", " Onepiece.jpg "," onepiece.jpg "," onepiece.jpg "," onepiece.jpg "," onepiece.jpg "," onepiece.jpg "]
};
_options = $.extend (_options,options);
var i, panel,ul,li,img;
Panel = document.createelement ("div");
UL = document.createelement ("ul");
Panel.classname= "Img-panel";
for (i=0;i<_options.img_list.length;i++) {
if (i%_options.cols==0&&i!=0) {
Panel.appendchild (UL);
UL = document.createelement ("ul");
}
Li = document.createelement ("Li");
Li.style.left = (_options.img_min_width+10) * parseint (I%_options.cols) + "px";
Li.style.top = (_options.img_min_height+10) * parseint (I/_options.cols) + "px";
img = document.createelement ("img");
IMG.SRC =_options.img_list[i];
Li.appendchild (IMG);
Ul.appendchild (LI);
}
$ (_options.depend). append (panel);
$ (". Img-panel li"). MouseOver (function (e) {
$ (e.currenttarget). CSS ("Z-index", "1000");
$ (e.currenttarget). Animate ({margin: "-" + (_options.img_max_width-_options.img_min_width)/2+ "px 0 0-" + (_options.img _max_height-_options.img_min_height)/2+ "px",
Width:_options.img_max_width + "px", Height: _options.img_max_height + "px"},500,function () {
$ (e.currenttarget). CSS ("Z-index", "1000");
});
});
$ (". Img-panel li"). MouseLeave (function (e) {
$ (e.currenttarget). Animate ({margin: "0", width:_options.img_min_width+ "px", height:_options.img_min_height+ "px"}, 200,function () {
$ (e.currenttarget). CSS ("Z-index", "10");
});
});
};
$. Imagepanel ({});
</script>
</body>
Effect
JS album, photo floating effect