jquery - 模拟这个效果,jquery draggable

标签 jquery css overflow draggable breadcrumbs

您好,我正在尝试获得类似的效果:https://www.tumblr.com/search/html

这是我当前的代码,基本上我希望面包屑左右滚动,但在最后一个/第一个面包屑离开视口(viewport)时停止。

这是到目前为止我的进度的 jsfiddle 检查每个帖子的哈希标签,如果 div 溢出,它们是可滚动的。

http://jsfiddle.net/omvjuutb/

$('#list-container').draggable({
    'axis': 'x',
});

最佳答案

这可能对您有所帮助。

$(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");
});

});

关于jquery - 模拟这个效果,jquery draggable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28090177/

相关文章:

html - 为什么 IE 8 中的文本输入字段总是比其他浏览器宽 6px?

css - Angular Material md-select - 无法打开选定用户的框

jquery - 使用 KineticJS 在鼠标悬停时重新着色形状

jquery - jquery 中的按钮文本切换

javascript - .removeClass ('visible' ).addClass ('invisible' );与 .hide() 或 .show()

php逻辑是使用if else条件还是多态

Qt4(哪个)小部件中的 HTML 和 CSS?

html - 如何在给定的总高度中堆叠多个 DIV,并在一个 DIV 上进行垂直滚动(无 JS)

c - 优化计算组合并避免溢出

linux - 通过 GDB 运行程序时函数位置是否改变?