* { margin:0; padding:0; }
body {
margin:5px auto;
text-align:center;
background:#f0f0f0;
}
img { margin:0; border:0; padding:0; }
#elore {
position:relative;
margin:0 auto;
width:800px; height:339px;
}
#elore_wrap {
position:relative;
margin:0 auto;
overflow:hidden;
width:800px; height:339px;
background:#369;
}
#elore .elore_img {
position:absolute; top:0;
width:120px; height:339px;
overflow:hidden;
font-size:50px;
line-height:340px;
}
#elore .elore_out {
position:absolute; top:0;
width:120px; height:339px;
overflow:hidden;
font-size:10px;
line-height:340px;
}
loading...
//<[cdata[
var elore_wrap = document.getelementbyid('elore_wrap');
var aimg = new array('//www.jb51.net/upload/112_jpg_thumb.jpg','//www.jb51.net/upload/123_jpg_thumb.jpg','//www.jb51.net/upload/112_jpg_thumb.jpg', '//www.jb51.net/upload/123_jpg_thumb.jpg');
var iimg = 0;
var ia = 0;
window.onload = function() {
elore_created();
}
function elore_created() {
if (iimg==10) {
elore_wrap.innerhtml = '';
iimg = 0;
}
if (iimg==0) {
elore_wrap.innerhtml += 'h\n';
}
/*
var sdiv = '' + iimg++ + '\n';
elore_wrap.innerhtml += sdiv;
*/
var odiv = document.createelement('div');
odiv.classname = 'elore_img';
odiv.style.right = iimg*80 +'px';
odiv.style.background = 'url(' + aimg[ia] + ') -720px top no-repeat';
//odiv.appendchild(document.createtextnode(iimg));
elore_wrap.appendchild(odiv);
iimg++;
elore_move();
}
function elore_move(){
var odiv = elore_wrap.getelementsbytagname('div');
for (var i=1; i<odiv.length; i++) {
var ibgpx = parseint(odiv[i].style.backgroundposition);
if (ibgpx<i*80-760) {
var imovepx = math.floor((760-i*80+ibgpx)/15);
odiv[i].style.backgroundposition = ibgpx - imovepx + 'px top';
} else {
odiv[i].style.backgroundposition = '-' + (760- i*80) + 'px top';
}
}
if (iimg<10) {
settimeout('elore_created()','50');
} else if (parseint(odiv[10].style.backgroundposition)
[ctrl+a 全选 注:如需引入外部js需刷新才能执行]