[英]i Using 2 JQuery plugins
我的网站使用JQuery运作良好。 在一页上,当文档(页面)准备就绪时,我使用以下方法调用JQuery:
<script type="text/javascript">
// Initialize the plugin with no custom options
$(document).ready(function () {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: "allDirections",
manualContinuousScrolling: true,
autoScrollingMode: "onStart"
})
});
</script>
另一个页面使用不同的JQuery插件
<script type="text/javascript">
$(document).ready(function () {
$(".fancybox").fancybox();
});
</script>
现在,我需要在同一页面上同时使用这两个插件。
以下代码完全停止了JQuery的工作,而我不知道正确的语法是什么
<script type="text/javascript">
// Initialize the plugin with no custom options
$(document).ready(function () {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: "allDirections",
manualContinuousScrolling: true,
autoScrollingMode: "onStart"
})
});
$(document).ready(function () {
$(".fancybox").fancybox();
});
</script>
我也试过
<script type="text/javascript">
// Initialize the plugin with no custom options
$(document).ready(function () {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: "allDirections",
manualContinuousScrolling: true,
autoScrollingMode: "onStart"
});
$(".fancybox").fancybox();
});
</script>
请让我知道我在做什么错
“我也尝试过”
<script type="text/javascript">
// Initialize the plugin with no custom options
$(document).ready(function () {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: "allDirections",
manualContinuousScrolling: true,
autoScrollingMode: "onStart"
}) }),
$(".fancybox").fancybox();
});
</script>
我认为应该是:
<script type="text/javascript">
// Initialize the plugin with no custom options
$(document).ready(function () {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: "allDirections",
manualContinuousScrolling: true,
autoScrollingMode: "onStart"
});
$(".fancybox").fancybox();
});
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.