我想使用在本网站上找到的jquery,但无法找到它不工作的原因my site。我是一名设计师,而不是开发人员。smoothdivscroll.com jquery滑块不工作
我有以下代码:
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript"> $(document).ready(function() { $("#makeMeScrollable").smoothDivScroll({ mousewheelScrolling: "allDirections", manualContinuousScrolling: true, autoScrollingMode: "onStart" }); }); </script>
</head>
<div id="makeMeScrollable">
<div class="scrollingHotSpotLeft" style="display: block; opacity: 0;"></div>
<div class="scrollingHotSpotRight" style="opacity: 0;"></div>
<div class="scrollWrapper">
<div class="scrollableArea" style="width: 3784px;">
<img src="http://test.doig.com.au/meyer/wp-content/uploads/2016/02/lenders-01.jpg" alt="Accreditations" id="Accreditations1" /><img src="http://test.doig.com.au/meyer/wp-content/uploads/2016/02/lenders-02.jpg" alt="Accreditations" id="Accreditations2" /><img src="http://test.doig.com.au/meyer/wp-content/uploads/2016/02/lenders-03.jpg" alt="Accreditations" id="Accreditations3" /><img src="http://test.doig.com.au/meyer/wp-content/uploads/2016/02/lenders-04.jpg" alt="Accreditations" id="Accreditations4" /></div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: "allDirections",
manualContinuousScrolling: true,
autoScrollingMode: "onStart"
});
});
</script>
感谢@saadeez替换所有$符号。我遵循你的建议,并确保所有的js文件都在那里,但现在滑块消失了。看不到原因。 – Steve
@Steve - 同时尝试添加smoothdivscroll的CSS文件名“smoothDivScroll.css”并将此CSS文件链接到您的Head标签上。 – saadeez
谢谢@sadeez。做到了,现在滑块已经消失。 :( – Steve