【问题标题】:jQuery Smooth Div Scroll with Colorbox带有颜色框的 jQuery 平滑 Div 滚动
【发布时间】:2012-10-02 18:00:46
【问题描述】:

我在网上找到了你的 jQuery Smooth Div Scroll 工具。我打算捐赠,但我无法像您在您的网站上那样使用颜色框选项: http://www.smoothdivscroll.com/colorbox.html

我是一名平面艺术家和网页设计师,正在寻找画廊选项来展示我的作品。似乎当我添加链接到大图像的 href 标记时,它会破坏可滚动图库。我在我的 html 的 head 部分中链接了一个 colorbox.css 文件:

<link rel="Stylesheet" type="text/css" href="css/colorbox.css" />

我在文档正文中也有这个:

<script type="text/javascript">
$(document).ready(function () {
// Init Smooth Div Scroll   
$("#makeMeScrollable").smoothDivScroll({
    mousewheelScrolling: "allDirections",
    manualContinuousScrolling: true
});

// Init colorbox
$("#makeMeScrollable a").colorbox({ speed: "500" });

});

我还缺少另一个拼图吗?一个javascript文件?

这个画廊可以完美运行。非常感谢您提供的任何帮助或建议!

谢谢,

格里

【问题讨论】:

    标签: jquery html colorbox smooth-scrolling


    【解决方案1】:

    Colorbox 包括:

    • jquery.colorbox.js
    • colorbox.css
    • 用于加载、边框、关闭等的图像

    【讨论】:

    • 我已经包含了以上所有内容。问题似乎是添加颜色框功能会破坏可滚动图库。我在幻灯片放映中只得到一张图像,滚动功能消失了。我可以在某处有冲突的脚本吗?这是HTML页面:gerardtonti.com/Scrollable%20Gallery%202/index.html
    • @user1715071 你有下一个问题:两张图片的 404 错误和无效的 html 标记,从所有图片链接中,只有第一个被关闭,第二个被打开,其他没有 &lt;a&gt; 标签。
    【解决方案2】:

    您需要包含 jQuery 库文件和颜色框脚本。

    <!-- jQuery library - Please load it from Google API's -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js" type="text/javascript"></script>
    <!-- jQuery UI Widget and Effects Core (custom download)
         You can make your own at: http://jqueryui.com/download -->
    <script src="js/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
    <!-- Latest version of jQuery Mouse Wheel by Brandon Aaron
         You will find it here: http://brandonaaron.net/code/mousewheel/demos -->
    <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
    <!-- jQuery Kinetic - for touch -->
    <script src="js/jquery.kinetic.js" type="text/javascript"></script>
    <!-- Smooth Div Scroll 1.3 minified-->
    <script src="js/jquery.smoothdivscroll-1.3-min.js" type="text/javascript"></script>
    <!-- If you want to look at the uncompressed version you find it at
         js/jquery.smoothDivScroll-1.3.js -->
    <!-- Colorbox -->
    <script src="js/jquery.colorbox-min.js" type="text/javascript"></script>
    

    【讨论】:

    • 谢谢,我已将库文件和颜色框脚本添加到 html 颜色框元素工作正常,但似乎打破了滚动。滚动库中仅显示第一张图片,当您尝试使用滚动图标时,第一张和第二张图片之间会闪烁。
    • 我的脚本可能有冲突吗?
    猜你喜欢
    • 2012-10-03
    • 2013-10-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-23
    • 2018-05-16
    • 1970-01-01
    • 1970-01-01
    • 2012-05-20
    相关资源
    最近更新 更多