Lightbox / Jquery Moleskine Notebook, javascript相互干扰

Lightbox / Jquery Moleskine Notebook, javascript interfering with each other

本文关键字:javascript 干扰 Notebook Jquery Moleskine Lightbox      更新时间:2023-09-26

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

我正在使用Moleskine Notebook Jquery(网站笔记本),我正在为一家日本公司制作漫画类型的漫画。他们想要的页面是图像(这是可以的),但他们想要点击的部分图像与灯箱风格(弹出式画廊类型的风格)。

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

我还尝试在头部代码中放置不同的代码。灯箱在下面,脚本在上面。这么多不同的方式,总是互相干扰。

有谁知道该怎么做吗?

干杯杰斯

    <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>

在jQuery加载之前,您还没有在页面和调用colorbox中包含colorbox.js文件。只使用colorbox css是不行的。另外,为什么使用这么老的jQuery版本?当前版本为1.9.10