简体   繁体   English

平滑 Div 滚动 jquery 不滚动

[英]Smooth Div Scroll jquery not scrolling

The Smooth Div Scroll is great but for some reason the area no longer scrolls when I edit or remove the #makeMeScrollable or #makeMeScrollable div.scrollableArea * When I leave it as is it works. Smooth Div Scroll 很棒,但由于某种原因,当我编辑或删除#makeMeScrollable 或#makeMeScrollable div.scrollableArea * 时,该区域不再滚动。 Which is a problem for customization.这是定制的问题。

and it won't work after I take the "*" out of div.scrollableArea *并且在我从 div.scrollableArea * 中取出“*”后它就不起作用了

If I edit the part with the如果我用

It's been frustrating figuring out why that part which is supposed to be editable not work at all.弄清楚为什么应该可编辑的部分根本不起作用,这令人沮丧。

Any help with this jquery would be helpful!对此 jquery 的任何帮助都会有所帮助! Thanks in advance!提前致谢!

/* You can alter this CSS in order to give SmoothDivScroll your own look'n'feel */

/* Invisible left hotspot */
div.scrollingHotSpotLeft
{
    /* The hotspots have a minimum width of 75 pixels 
       and if there is room the will grow and occupy 10% 
       of the scrollable area (20% combined). 
       Adjust it to your own taste. */
    min-width: 75px;
    width: 10%;
    height: 100%;
    /* There is a big background image and it's used to 
    solve some problems I experienced in Internet Explorer 6. */
    background-image: url(../images/big_transparent.gif);
    background-repeat: repeat;
    background-position: center center;
    position: absolute;
    z-index: 200;
    left: 0;
    /*  The first cursor url is for Firefox and other 
        browsers, the second is for Internet Explorer */
    cursor: url(../images/cursors/cursor_arrow_left.cur), url(images/cursors/cursor_arrow_left.cur),w-resize;
}

/* Visible left hotspot */
div.scrollingHotSpotLeftVisible
{
    background-image: url(../images/arrow_left.gif);                
    background-color: #fff;
    background-repeat: no-repeat;
    /* Standard CSS3 opacity setting */
    opacity: 0.35; 
    /* Opacity for really old versions of 
       Mozilla Firefox (0.9 or older) */
    -moz-opacity: 0.35;
    /* Opacity for Internet Explorer. */
    filter: alpha(opacity = 35);
    /* Use zoom to Trigger "hasLayout" in 
       Internet Explorer 6 or older versions */ 
    zoom: 1; 
}

/* Invisible right hotspot */
div.scrollingHotSpotRight
{
    min-width: 75px;
    width: 10%;
    height: 100%;
    background-image: url(../images/big_transparent.gif);
    background-repeat: repeat;
    background-position: center center;
    position: absolute;
    z-index: 200;
    right: 0;
    cursor: url(../images/cursors/cursor_arrow_right.cur), url(images/cursors/cursor_arrow_right.cur),e-resize;
}

/* Visible right hotspot */
div.scrollingHotSpotRightVisible
{
    background-image: url(../images/arrow_right.gif);
    background-color: #fff;
    background-repeat: no-repeat;
    opacity: 0.35;
    filter: alpha(opacity = 35);
    -moz-opacity: 0.35;
    zoom: 1;
}

/* The scroll wrapper is always the same width and 
   height as the containing element (div). Overflow 
   is hidden because you don't want to show all of 
   the scrollable area.
*/
div.scrollWrapper
{
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

div.scrollableArea
{
    position: relative;
    width: auto;
    height: 100%;
}
#makeMeScrollable
{
width:100%;
height: 330px;
position: relative;
}
#makeMeScrollable div.scrollableArea *
{
position: relative;
float: left;
margin: 0;
padding: 0;
}

http://www.smoothdivscroll.com/ http://www.smoothdivscroll.com/

//^above link to the jquery I am talking about //^上面链接到jquery 我在说

Is this still a problem or has it been solved?这仍然是一个问题还是已经解决了? Since you asked this question version 1.2 has been released and it works a bit differently than version 1.1.既然你问了这个问题,1.2 版已经发布,它的工作方式与 1.1 版有点不同。

In your question you mention that things stop working when you take out the asterisk in the CSS identifier "div.scrollableArea *".在您的问题中,您提到当您取出 CSS 标识符“div.scrollableArea *”中的星号时,事情会停止工作。 This identifier is just saying "anything/any type of element that is inside the scrollableArea. If you remove it you need to replace it with something more specific. If you have images you use "div.scrollableArea img". If you have div's you use "div.scrollableArea div", if you have linked things you use "div.scrollableArea a" and so on.这个标识符只是说“可滚动区域内的任何/任何类型的元素。如果你删除它,你需要用更具体的东西替换它。如果你有图像,你使用“div.scrollableArea img”。如果你有 div使用“div.scrollableArea div”,如果你有链接的东西你使用“div.scrollableArea a”等等。

The important thing is that the elements that are inside the scrollableArea are displayed in one long line.重要的是,可滚动区域内的元素以一长行显示。 The method I've used for accomplishing this is to make their position relative , float them left and set their display property to block (needed for the elements to claim their specific horizontal space in the DOM).我用来完成此操作的方法是使它们的position 相对将它们向左浮动并将它们的显示属性设置为阻塞(需要元素在 DOM 中声明它们的特定水平空间)。 Apart from that you can set pretty much anything else to your own taste.除此之外,您几乎可以根据自己的喜好设置任何其他内容。

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

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