[英]i Using 2 JQuery plugins
My website works well, using JQuery. 我的网站使用JQuery运作良好。 On one page, I call the JQuery when the document (page) is ready, using
在一页上,当文档(页面)准备就绪时,我使用以下方法调用JQuery:
<script type="text/javascript">
// Initialize the plugin with no custom options
$(document).ready(function () {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: "allDirections",
manualContinuousScrolling: true,
autoScrollingMode: "onStart"
})
});
</script>
Another page, which uses a different JQuery plugin, does 另一个页面使用不同的JQuery插件
<script type="text/javascript">
$(document).ready(function () {
$(".fancybox").fancybox();
});
</script>
Now, I need to have both of these plugins on the same page. 现在,我需要在同一页面上同时使用这两个插件。
The following code stops the JQuery working completely, and I'm lost to what is the correct syntax 以下代码完全停止了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>
I also tried 我也试过
<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>
Please let me know what I'm doing wrong 请让我知道我在做什么错
"i also tried" “我也尝试过”
<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>
i think it should be: 我认为应该是:
<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.