http://www.smoothdivscroll.com/のサイトにあるスムーズな div スクローラーを使用しています。
なんらかの理由で機能していません。その理由はわかりません。私が得ているのは、スクロールしない固定画像のページだけです。ここに私のHTMLがあります:
<div id="makeMeScrollable">
<div class="scrollingHotSpotLeftVisible"></div>
<div class="scrollingHotSpotRightVisible"></div>
<div class="scrollWrapper">
<div class="scrollableArea">
<a href="#"><img src="some-image.png"/></a>
<a href="#"><img src="some-image.png"/></a>
<a href="#"><img src="some-image.png"/></a>
<a href="#"><img src="some-image.png"/></a>
<a href="#"><img src="some-image.png"/></a>
<a href="#"><img src="some-image.png"/></a>
<a href="#"><img src="some-image.png"/></a>
</div>
</div>
これが私のスクリプトです:
<script type="text/javascript" src="jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="jquery.smoothdivscroll-1.2-min.js"></script>
<script src="jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery-ui-1.8.18.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="smoothDivScroll.css" />
<script type="text/javascript">
$(document).ready(function() {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: true,
manualContinuousScrolling: true,
visibleHotSpotBackgrounds: "always",
autoScrollingMode: "onstart"
});
});
</script>
これが私のCSSです:
a img {border: none; }
#makeMeScrollable
{
width:75%;
height:60px;
position: relative;
display: block;
float: left;
padding: 0;
margin: 0;
}
#makeMeScrollable div.scrollableArea img
{
position: relative;
float: left;
margin: 0;
padding: 0;
/* If you don't want the images in the scroller to be selectable, try the following
block of code. It's just a nice feature that prevent the images from
accidentally becoming selected/inverted when the user interacts with the scroller. */
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
}
たぶん、私が見落としていたり、見ていなかったりする、本当に単純なことだと思いますが、しばらく経ちましたが、まだ理解できていません。
アップデート
これが私のコードのJsFiddleですどうもありがとう。