函数调用问题,麻烦大家帮忙一下
html吧
全部回复
仅看楼主
level 1
王八当qq 楼主
问题:dj() dc()这个位置是错的,想要调用next.click(function(),应该怎么写,如何调用
< script type = "text/javascript" >
function DY_scroll(wraper, prev, next, img, speed, or) {
var wraper = $(wraper);
var prev = $(prev);
var next = $(next);
var img = $(img).find('ul');
var w = img.find('li').outerWidth(true);
var s = speed;
next.click(function() {
img.animate({
'margin-left': -w
},
function() {
img.find('li').eq(0).appendTo(img);
img.css({
'margin-left': 0
});
});
});
prev.click(function() {
img.find('li:last').prependTo(img);
img.css({
'margin-left': -w
});
img.animate({
'margin-left': 0
});
});
if (or == true) {
ad = setInterval(function() {
next.click();
},
s * 1000);
wraper.hover(function() {
clearInterval(ad);
},
function() {
ad = setInterval(function() {
next.click();
},
s * 1000);
});
}
}
DY_scroll('.div1', '.prev', '.next', '.img-list', 1, false);
function KeyDown(e) {
e = window.event || e
if (window.event.keyCode == 39) {
dj();
} //dj()这个位置是错的,想要调用 next.click(function() ,应该怎么写,如何调用
if (window.event.keyCode == 40) {
dc();
}
if (window.event.keyCode == 37) {
dj();
}
if (window.event.keyCode == 38) {
dc();
}
} < /script>/
2018年04月16日 23点04分 1
1