Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 views
in Technique[技术] by (71.8m points)

html - jquery conflict not running two jquery in same page

<link rel="stylesheet" href="css/form.css" type="text/css" />
<script src="js/enquire-now.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/colorbox.css" type="text/css" />
<link rel='stylesheet' href='css/style.css' />
<link href="css/Arimo.css" rel='stylesheet' type='text/css'>
<link href='css/Driod.css' rel='stylesheet' type='text/css'>
<link href='css/Cabin.css' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<!-- must have -->
<link href="css/allinone_contentSlider.css" rel="stylesheet" type="text/css">
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/jquery.ui.touch-punch.min.js" type="text/javascript"></script>
<script src="js/allinone_contentSlider.js" type="text/javascript"></script>
<!--[if IE]><script src="js/excanvas.compiled.js" type="text/javascript"></script><![endif]-->
<!-- must have -->
<script src="js/mysubmenu.js" type="text/javascript"></script>
<script src="js/floating-1.12.min.js" type="text/javascript"></script>
<script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $("#contact-toggle").click(function() {
            $("#panel").slideToggle("slow");
            $(this).toggleClass("contact-active");
            return false;
        });
    });
</script>

<script>
    jQuery(function() {
        jQuery('#allinone_contentSlider_common').allinone_contentSlider({
            skin: 'common',
            width: $(window).width() - 35,
            height: 1000,
            autoHideBottomNav: false,
            showPreviewThumbs: false,
            autoHideNavArrows: false,
            thumbsWrapperMarginBottom: -50
        });
    });
</script>

i am using this code the upper code is used for a login link on that i got a like lightbox a pop up for login and the lower code is used for rotating the slider the rotator is working but the login link is not working i have another page on that i dont have slider and i am using the same code for my login link and its working on that page soo i think its a conflict issue so please give me some suggestion to resolve this problem

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

use .noConflict()

<script  src="../jquery-1.9.1.min.js"></script> 
<script type="text/javascript">
var first= $.noConflict(true);
</script>

<!-- load jQuery 1.4.2 -->
<script type="text/javascript" src="../jquery-1.2.2.js"></script>
<script type="text/javascript">
var second= $.noConflict(true);
</script>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...