首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Lightbox / Jquery Moleskine Notebook,javascript相互干扰

Lightbox / Jquery Moleskine Notebook,javascript相互干扰
EN

Stack Overflow用户
提问于 2013-03-28 08:09:20
回答 1查看 327关注 0票数 0

我想知道是否有人有任何想法或可以帮助我解决一个小问题。(标题代码如下)

我正在使用Moleskine Notebook Jquery (网站笔记本),我正在为一家日本公司制作漫画类型的漫画。他们希望页面是图像(这是可以的),但他们希望单击图像的部分具有lightbox样式(弹出式图库类型样式)。

当我合并这两个代码时,javascript必须相互干扰,它不能工作。也许是因为图像在moleskine笔记本的div中?当我点击链接到lightbox div的图片时,它并没有打开lightbox,它只是在一个新的页面中打开图片。

我还尝试在头代码中以不同的方式放置代码。灯箱在底部,脚本在顶部。有这么多不同的方式,它们总是相互干扰。

有没有人知道该怎么做呢?

干杯,杰西

代码语言:javascript
运行
复制
    <script>
    jQuery.noConflict();
        $(document).ready(function(){
            $(".group1").colorbox({rel:'group1'});
            $(".group2").colorbox({rel:'group2', transition:"fade"});
            $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
            $(".group4").colorbox({rel:'group4', slideshow:true});
            $(".ajax").colorbox();
            $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
            $(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
            $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
            $(".inline").colorbox({inline:true, width:"50%"});
            $(".callbacks").colorbox({
                onOpen:function(){ alert('onOpen: colorbox is about to open'); },
                onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
                onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
                onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
                onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
            });

            $('.non-retina').colorbox({rel:'group5', transition:'none'})
            $('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});

            //Example of preserving a JavaScript event for inline calls.
            $("#click").click(function(){ 
                $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
                return false;
            });
        });
    </script>


    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
    <script src="booklet/jquery.easing.1.3.js" type="text/javascript"></script>
    <script src="booklet/jquery.booklet.1.1.0.min.js" type="text/javascript"></script>

    <link href="booklet/jquery.booklet.1.1.0.css" type="text/css" rel="stylesheet" media="screen" />
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="colorbox.css" />

    <script src="cufon/cufon-yui.js" type="text/javascript"></script>
    <script src="cufon/ChunkFive_400.font.js" type="text/javascript"></script>
    <script src="cufon/Note_this_400.font.js" type="text/javascript"></script>
    <script type="text/javascript">
        Cufon.replace('h1,p,.b-counter');
        Cufon.replace('.book_wrapper a', {hover:true});
        Cufon.replace('.title', {textShadow: '1px 1px #C59471', fontFamily:'ChunkFive'});
        Cufon.replace('.reference a', {textShadow: '1px 1px #C59471', fontFamily:'ChunkFive'});
        Cufon.replace('.loading', {textShadow: '1px 1px #000', fontFamily:'ChunkFive'});
    </script>
EN

回答 1

Stack Overflow用户

发布于 2013-05-31 14:08:48

甚至在加载jQuery之前,您还没有在页面和调用颜色盒中包含colorbox.js文件。它不会只与colorbox css一起工作。另外,为什么会有这么老版本的jQuery呢?当前版本为1.9.10

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15671930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档