Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbox2(prototype.js) vs. Slideshow(jQuery.js)

    Hi,
    I have the following problem. I've made a strict html/css website with a jquery slideshow as a header. This works fine.
    But when i tried to make the gallery-page with lightbox2, it won't show the images in the slideshow anymore. I've googled the problem and read many search results and they all show the same solution.
    Code:
    <script>
         jQuery.noConflict();
         
         // Use jQuery via jQuery(...)
         jQuery(document).ready(function(){
           jQuery("something div").hide();
         });
         
         // Use Prototype with $(...), etc.
         $('someid').hide();
       </script>
    It's all fine by me, but the problem is i dont know how to apply this code.
    Here is the code of my head-section:
    Code:
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    	<link rel="stylesheet" type="text/css" href="css/style.css" />
    	<script type="text/javascript" src="jscript/jquery.js"></script>
    	<script type="text/javascript" src="jscript/mhslideshow.js"></script>
    	<script type="text/javascript" src="jscript/initblindsheader.js"></script>
    	<link rel="stylesheet" href="jscript/mhslideshow.css" type="text/css" />
    	<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>
    </head>
    I don't know what to fill in in the "something div" and "someid"-section.
    It's prolly a stupid question, but I'm still seeking for the answer

    All help are appreciated.
    Thanx in advance.

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,355
    Thanks
    11
    Thanked 558 Times in 551 Posts
    The above code is just an example showing you how to use jQuery.noConflict(). There is no need to set "someid" or "something div" to anything.

    The code only shows you that all of your jQuery code goes into jQuery(document).ready() and the prototype code stays outside of it.

    Btw. it's generally not recommended to use more than one framework. There are TONS of lightbox related plugins out there for jQuery.

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by devnull69 View Post
    The above code is just an example showing you how to use jQuery.noConflict(). There is no need to set "someid" or "something div" to anything.

    The code only shows you that all of your jQuery code goes into jQuery(document).ready() and the prototype code stays outside of it.

    Btw. it's generally not recommended to use more than one framework. There are TONS of lightbox related plugins out there for jQuery.
    all good, but what i still want to use lightbox2?
    how do i apply the .noconflict() on it?
    thx for the fast reaction

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,462
    Thanks
    0
    Thanked 633 Times in 623 Posts
    The latest version of Lightbox2 uses jQuery rather than prototype so all you need to do to resolve the conflict is to upgrade to the latest version at http://drupal.org/project/lightbox2
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •