Jquery Scroller needs to stop scrolling after reaching end
Iam using a scroller in one of my website. When i click the down arrow to scroll the scroller to the end, 10:00 PM
reached. Again if i clicked down arrow, the scroller again moves up and whole content disappears. I want to stop the down arrow's working if the end time [Here 10:00 PM]
reached.
Same problem occurs in case clicking of up arrow. We tried to solve this but didn't succeed.
Jsfiddle link: http://jsfiddle.net/Xh59R/3/
Image attatched.
Thanks in advance.
Check the following jsfiddle link... http://jsfiddle.net/Xh59R/8/
For next button click..
$scrollerNextButton.click(function(e){
//PUT THESE AT END
var divMargnTop=parseInt(document.getElementById("DemoShowHide").style.top);
var divMaxTopAllowed=parseInt(-1600);
if(divMargnTop<=divMaxTopAllowed)
{
$scrollerNextButton.stop().hide("fast");
}
});
For prev button click..
var divMinMargnTop=parseInt(document.getElementById("DemoShowHide").style.top);
var divMinMaxTopAllowed=parseInt(0);
if(divMinMargnTop>=divMinMaxTopAllowed)
{
$scrollerPrevButton.stop().hide("fast");
}
http://jsfiddle.net/Xh59R/8/
我认为你可以使用这样的东西:
$scrollerNextButton.click(function (e) {
var lines = $("div[style*='width:100%']");
var total = lines.outerHeight(true) * lines.length;
if ($scroller.position().top > total) {
$scrollerNextButton.stop().hide("fast");
}
});
链接地址: http://www.djcxy.com/p/20936.html
上一篇: 增加CUDA中每个线程的工作量的示例