简体   繁体   English

水平滚动菜单

[英]Horizontal Scroll menu

My menu will display based on the My SQL DATABASE using ul li.我的菜单将使用 ul li 基于 My SQL DATABASE 显示。 Currently there are six menus visible in the website.目前,网站上有六个菜单可见。 while I increase my menu more than six, It has to show in scroll like image slider with previous and next button options.当我将菜单增加到六个以上时,它必须像图像滑块一样滚动显示,并带有上一个和下一个按钮选项。 So that the menu will get scrolled horizontally.这样菜单就会水平滚动。

One important point is, next button should be visible only if the menu increases more than six.一个重要的点是,只有当菜单增加超过六个时,下一个按钮才应该可见。 Otherwise next or previous button should not show.否则下一个或上一个按钮不应显示。

Let me know if i can able to get any script or html code for this.让我知道我是否能够为此获得任何脚本或 html 代码。

hope this should be help you see link希望这应该可以帮助您查看链接

DEMO演示

$(document).ready(function () {
    $('.right').click(function () {
        var position = $('.container').position();
        var r=position.left-$(window).width()
        $('.container').animate({
            'left': ''+r+'px'
        });
    });    

    $('.left').click(function () {
        var position = $('.container').position();
        var l=position.left+$(window).width()
        if(l<=0)
        {
        $('.container').animate({
            'left': ''+l+'px'
        });
        }
    });    
});

SEE THE FIDDLE LINK查看小提琴链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM