Using two jQuery plugins in one html document... Am I missing something?
Hi there
I want to use two jQuery plugins on one html page. I have got each plugin to work when only one plugin is included, but only one works when both are included.
The two plugins in question are Lightbox and the Cycle Lite plugin.
Code in header:
- <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
- <script type="text/javascript" src="js/prototype.js"></script>
- <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
- <script type="text/javascript" src="js/lightbox.js"></script>
- <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
- <script type="text/javascript" src="js/jquery.cycle.lite.1.0.js"></script>
- <script type="text/javascript">
- $(function(){
- $('#banner').cycle({
- timeout: 8000
- });
- });
- </script>
With this code, Cycle Lite works but Lightbox does not. If I remove this line:
- <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
then Lightbox works but Cycle Lite doesn't. So I presume it is a conflict between the javascripts that are loading?
Could someone shed some light on this, please. I'm sure it's straight forward... if you know. But javascript and jQuery is something I don't know much about... yet. Clearly.
Thanks in advance. H