问题
i'm using 3 different JQuery plugins to build a website.
- http://web-kreation.com/demos/Sliding_login_panel_jquery/
- http://www.thewebsqueeze.com/web-design-tutorials/create-a-horizontal-scrolling-website.html
- LINK3:http://fancyapps.com/fancybox/
But, there's a small problem. The first 2 plugins work happily together, but when I insert Fancybox, one of the plugins (mostly Fancybox, but sometimes Sliding Login) will be disabled and behaves himself as it would do without JQuery.
<!-- PNG FIX for IE6 -->
<!-- http://24ways.org/2007/supersleight-transparent-png-in-ie6 -->
<!--[if lte IE 6]>
<script type="text/javascript" src="js/pngfix/supersleight-min.js"></script>
<![endif]-->
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script>
<script src="js/jquery.localscroll-min.js" type="text/javascript"></script>
<script src="js/jquery.scrollTo-min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.fancybox.js?v=2.0.6"></script>
<script type="text/javascript" src="js/jquery.mousewheel-3.0.6.pack.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$.localScroll.defaults.axis = 'x';
$.localScroll();
// Expand Panel
$("#open").click(function(){
$("div#panel").slideDown("slow");
});
// Collapse Panel
$("#close").click(function(){
$("div#panel").slideUp("slow");
});
// Switch buttons from "Log In | Register" to "Close Panel" on click
$("#toggle a").click(function () {
$("#toggle a").toggle();
});
$("a.fancybox").fancybox();
});
</script>
And here's the link:
<a class="fancybox" href="http://www.google.nl?id=<? echo $selectusers2['UID'] ?>" title="<? echo $selectusers2['test']." ".$selectusers2['test']." ".$selectusers2['test']; ?>"><? echo abbreviation($selectusers2['test']." ".$selectusers2['test']." ".$selectusers2['test'],17,'...'); ?></a><br />
I hope someone will know why those are conflicting and likes to solve it :)
回答1:
Fancybox v2.x requires jQuery v1.6 or later. Upgrade your version of jQuery
You could call the latest version of jQuery with this
<script src="http://code.jquery.com/jquery-latest.js"></script>
来源:https://stackoverflow.com/questions/10356879/conflict-between-fancybox-and-other-jquery