彩盒和表单样式之间的冲突

时间:2013-06-04 12:05:50

标签: javascript jquery conflict

我有一个“colorbox Js。”与“形式造型Js。”在我的标题上现在是“形式造型Js。”在我把colorbox javascript搜索到我的问题之后再也没有工作了,我发现这个叫做“javascript冲突”,我试过这个

<script>jQuery.noConflict();</script>

但它没有解决我的问题

这是带有样式

的颜色框脚本
<!--Form styleing-->

    <link rel="stylesheet" href="includes/formStyles/jqtransform.css" type="text/css" media="all" />
    <link rel="stylesheet" href="demo.css" type="text/css" media="all" />
    <script type="text/javascript" src="includes/formStyles/jquery.js" ></script>
    <script type="text/javascript" src="includes/formStyles/jquery.jqtransform.js" ></script>
    <script language="javascript">
        jQuery(document).ready(function(){
            $('form').jqTransform({imgPath:'includes/formStyles/img/'});
        });
    </script>
<!--Form styleing-->


<!-- ColorBox Script add by Yousef Altaf Wasti 24 March 2012 -->
<link rel="stylesheet" href="includes/colorbox/colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="includes/colorbox/jquery.colorbox.js" type="text/javascript"></script>
<script type="text/javascript">
            jQuery(document).ready(function(){
                //Examples of how to assign the ColorBox event to elements
                $(".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});
                $(".iframe").colorbox({rel:'nofollow', iframe:true, width:"750", height:"780"});
                $(".iframe").colorbox({onLoad: function() {$('#cboxClose');}});
                $(".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'); }
                });
                //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>
<!-- End script --> 

如何让他们在任何帮助下一起工作。

顺便说一句,如果这可以帮助这是有问题的页面 http://www.hostnile.com

1 个答案:

答案 0 :(得分:0)

无需添加two times jquery 试试这个,

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="includes/formStyles/jquery.jqtransform.js" ></script>
<script language="javascript">
    jQuery(document).ready(function(){
        $('form').jqTransform({imgPath:'includes/formStyles/img/'});
    });
</script>
<script src="includes/colorbox/jquery.colorbox.js" type="text/javascript"></script>
<script type="text/javascript">
    jQuery(document).ready(function(){
        //Examples of how to assign the ColorBox event to elements
        $(".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});
        $(".iframe").colorbox({rel:'nofollow', iframe:true, width:"750", height:"780"});
        $(".iframe").colorbox({onLoad: function() {$('#cboxClose');}});
        $(".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'); }
        });
        //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>