根据位置或div启动水平滚动

时间:2013-03-12 18:58:08

标签: jquery position horizontal-scrolling

我试图在单个div中使用水平滚动,或者更确切地说(顶部> 1400)。基本上,向下滚动,遇到有问题的div - 然后水平滚动。 但是,这会导致页面上的元素在向下滚动时被右边距覆盖,或者完全禁用滚动。

我一直在尝试

$(function(){
   $("#art").wrapInner("<table cellspacing='30'><tr>");
   $("#info").wrap("<td></td>");
   $("#info").mousewheel(function(event, delta) {
      if (top > 1400) {
         this.scrollLeft += (delta * 30);
         event.preventDefault();
      }
      else {
         event.Default();
      }
   });   
});

<div id="art">
   <section id="info" data-type="background" data-speed="3" class="pages">
      ...  
   </section>
</div>

#info {
   background: url(time.JPG) 50% 0 repeat fixed; 
   min-height: 1000px;
   height: 730px;
   margin: 0 auto;
   width: 300%;
   max-width: 2000px;
   position: relative;
   cursor:help;
}

我知道这很混乱我一直在摸索试图让它以不同的方式运作。

我从这个鼠标滚轮示例中获得了原始代码 http://css-tricks.com/snippets/jquery/horz-scroll-with-mouse-wheel/#comment-301955

0 个答案:

没有答案