Javascript 如何让crossSlide和lightbox2在同一页面上协同工作
(横向滑动) (灯箱) 这是我的标题:Javascript 如何让crossSlide和lightbox2在同一页面上协同工作,javascript,jquery,thickbox,lightbox2,Javascript,Jquery,Thickbox,Lightbox2,(横向滑动) (灯箱) 这是我的标题: <script type="text/javascript" src="<?php echo ROOT.'sources/js/jquery.js'; ?>"></script> <script type="text/javascript" src="<?php echo ROOT.'sources/js/contentSlider/jquery.cross-slide.js'; ?>"><
<script type="text/javascript" src="<?php echo ROOT.'sources/js/jquery.js'; ?>"></script>
<script type="text/javascript" src="<?php echo ROOT.'sources/js/contentSlider/jquery.cross-slide.js'; ?>"></script>
<link rel="stylesheet" href="<?php echo ROOT.'sources/css/lightbox.css'; ?>" type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo ROOT.'sources/js/lightbox/prototype.js'; ?>"></script>
<script type="text/javascript" src="<?php echo ROOT.'sources/js/lightbox/scriptaculous.js?load=effects,builder'; ?>"></script>
<script type="text/javascript" src="<?php echo ROOT.'sources/js/lightbox/lightbox.js'; ?>"></script>
尝试将代码段更改为以下内容:
jQuery(function() {
jQuery('#imgHold').crossSlide({
sleep: 3,
fade: .5
}, [
{ src: 'images/featured/ftcont_img1.png' },
{ src: 'images/featured/ftcont_img2.png' },
{ src: 'images/featured/ftcont_img3.png' },
{ src: 'images/featured/ftcont_img4.png' }
]);
});
只要页面上没有其他冲突,这可能会起作用
请参阅docs.jquery.com,了解如何将jquery与其他库(如prototype和scriptaculous)一起使用,您在示例中使用了这两个库。jquery、prototype和scriptaculous?哎呀!非常感谢。这正是我想要的。但是当我测试lightbox脚本时,它不会加载任何函数按钮(next、prev、close)。我不确定这是否是我这边的问题,我弄乱了链接,所以我将对此进行研究,但感谢您帮助我使crossSlide正常工作。不用担心。另一个问题与图像路径有关。你需要编辑lightbox.js来更新它们-它们非常接近顶部。我修复了图像路径,但仍然不起作用。有什么想法吗?你100%确定他们是对的?如果您右键单击并“检查元素”(在Firefox中使用Chrome或Firebug)关闭按钮的位置,然后查看img标记。src是否指向您在服务器上的映像位置?您是否可以发布指向示例的链接?
jQuery(function() {
jQuery('#imgHold').crossSlide({
sleep: 3,
fade: .5
}, [
{ src: 'images/featured/ftcont_img1.png' },
{ src: 'images/featured/ftcont_img2.png' },
{ src: 'images/featured/ftcont_img3.png' },
{ src: 'images/featured/ftcont_img4.png' }
]);
});