Sliding divs horizontally with JQuery

后端 未结 5 679
我在风中等你
我在风中等你 2020-12-03 01:49

so I\'m very new to Javascript and Jquery. What I\'d like to create is a two column page where links on the left column will cause a div on the right to slide in horizontall

5条回答
  •  遥遥无期
    2020-12-03 02:22

    Here is the code that you want. It's proved that works on IE, Safari, Chrome, Firefox, etc.

    Here is the HTML part.

        

    Here is jQuery part in JavaScript function.

           function scrollThumb(direction) {
            if (direction=='Go_L') {
                $('#slide-wrap').animate({
                    scrollLeft: "-=" + 250 + "px"
                }, function(){
                    // createCookie('scrollPos', $('#slide-wrap').scrollLeft());
                });
            }else
            if (direction=='Go_R') {
                $('#slide-wrap').animate({
                    scrollLeft: "+=" + 250 + "px"
                }, function(){
                    // createCookie('scrollPos', $('#slide-wrap').scrollLeft());
                });
            }
           }
    

    For hiding the arrows please looking here. Detect end of horizontal scrolling div with jQuery

提交回复
热议问题