试图让它滚动基于它是在页面的左侧还是右侧单击。似乎不起作用..也许我的语法不正确或者我用来查找页面左侧或右侧的方法是?
与<body onclick="scrollevent()">
:
<script>
function scrollevent()
{
var y=0;
var pwidth = $('#slideshow').width();
var mouseY = ev.clientY;
if (mouseY<(pwidth/2) {
$('#slideshow').animate({scrollLeft: "+=400"});
}
else{
$('#slideshow').animate({scrollLeft: "-=400"});
}
}
</script>