嗨,我正试着得到与so:https://www.tumblr.com/search/html类似的效果。
这是我的当前代码,基本上我希望面包屑向左和向右滚动,但在最后/第一个面包屑不在视图端口时停止。
到目前为止,这里是我的进展的一部分,检查每个帖子的散列标记,如果div溢出,它们就可以滚动。
$('#list-container').draggable({
'axis': 'x',
});发布于 2015-01-22 14:05:22
这可能对你有帮助。
$(function() {
$( "#list-container" ).draggable({
'axis':'x',
scrollSensitivity: 100,
stop: function( event, ui ) {
//alert(ui.position.left);
if(ui.position.left <= 200){
$(this).draggable( "disable" );
}
}
});
$("#list-container").click(function(){
$(this).draggable("enable");
});});
https://stackoverflow.com/questions/28090177
复制相似问题