We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23299
    • 1,161 Posts
    Shane,

    I printed the output from the successful Thickbox page and the troublesome Fancybox page. I caught one msitake on my part. The path to the jquery.fancybox.js was wrong. I had the folder in the path as /js/ when it should have been /jq/

    I fixed that but the Fancybox eye candy is still not working. Clicking a thumbnail will present the full size image in its own window.

    Here is the relevant output: I snipped out the top, right column, footer etc. The site functions just fine otherwise. The MaxiGallery "Manage Photographs" works on both the Thickbox and the Fancybox gallery pages.
    <![endif]-->
    
            <script src="assets/templates/phototest/jq/jquery-1.2.6.js" type="text/javascript"></script>
    
    
    
    <! nav javascript starts here! >
    <script>
    jQuery(function() {
          // set opacity to nill on page load
           jQuery("ul#topnav span").css("opacity","0");
          // on mouse over
         jQuery("ul#topnav span").hover(function () {
             // animate opacity to full
             jQuery(this).stop().animate({
                opacity: 1
             }, 'slow');
          },
          // on mouse out
          function () {
             // animate opacity to nill
             jQuery(this).stop().animate({
                opacity: 0
             }, 'slow');
          });
    
       });
    </script>
    <! nav javascript ends !>
    
     <script type="text/javascript" src="assets/templates/phototest/jq/jquery.fancybox.js"></script> 
    	<script type="text/javascript" src="assets/templates/phototest/jq/jquery.pngFix.js"></script> 
    	<script type="text/javascript"> 
    		jQuery.noConflict();
    		jQuery(document).ready(function($){ 
    		$(document).pngFix(); 
    		$("li.image_gallery a").fancybox({ 'hideOnContentClick': true });
    		}); 
    
    	</script>
    
    
    
    
    
    <link rel="stylesheet" href="/seattlerealestate/assets/snippets/maxigallery/css/default.css" type="text/css" media="screen" />
    </head>
    
    <body>
    <div id="wrapper">
    	<ul id="topnav">
        	<li><a href="index.php?id=1" class="home"><span></span></a></li>
         <li><a href="index.php?id=2" class="portfolio"><span></span></a></li>
         <li><a href="index.php?id=3" class="services"><span></span></a></li>
    	<li><a href="index.php?id=4" class="about"><span></span></a></li>
    	<li><a href="index.php?id=5" class="contact"><span></span></a></li>
        </ul>
    
    	
    
     <div id="content">
    <div id="left_column"><!-- left column begins -->
    <h1><a href="index.php?id=1"</a></h1>
    
    		<div class="post">
    	<h3 id="post-">Bedrooms </h3>	
    <p> </p>
    <p>Click any thumbnail to activate gallery.<br />Click the right side of the image to advance to the next photo.<br />Click the left side of the image to return to previous photo.</p>
    <p>
    
    	<center><form action="/seattlerealestate/index.php?id=9" method="post" name="activateadminform">
    	<input type="hidden" name="mode" value="admin" />
    	<input type="submit" value="Manage pictures" />
    </form></center>
    	<br />
    	
    
    
    
    
    
    
    
    
    
    	
    		<div class="thumbscontainer">
    			<ul class="thumbs">
    				<li class="image_gallery">
        <a href="/seattlerealestate/assets/galleries/9/mojo_guarddog.jpg" class="fancybox" rel="gallery">
            <img src="/seattlerealestate/assets/galleries/9/tn_mojo_guarddog.jpg" class="thumbnail" title="Dog
             » Click to zoom ->" alt="Dog  » Click to zoom ->" />
        </a>
        
            <p style="width: 126px;">
                Dog
            </p>
        
    </li><li class="image_gallery">
        <a href="/seattlerealestate/assets/galleries/9/smudge_rokkor1.jpg" class="fancybox" rel="gallery">
            <img src="/seattlerealestate/assets/galleries/9/tn_smudge_rokkor1.jpg" class="thumbnail" title="Cat
             » Click to zoom ->" alt="Cat  » Click to zoom ->" />
        </a>
        
            <p style="width: 126px;">
                Cat
            </p>
        
    </li>
    			</ul>
    		</div>
    	
    </p>
    <p> </p>
    
     </div><!-- post closes(left_column content) -->
    </div><!-- left column ends -->
    


    The main difference I see between this page and the Thickbox page is the "jQuery" vs "$" usage in the nav script call and the call code for the Fancybox script...


      • 7923
      • 4,213 Posts
      Couple questions..

      1. Why are you using jQuery in noConflict mode for FancyBox? You use jQuery for everything on that page, so you don’t need to mess with the noConflict mode..
      2. Where’s FancyBox css file included and does the image paths point to correct paths in FancyBox css file?


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 23299
        • 1,161 Posts
        I thought the Fancybox needed the noConflict added? I will try removing that next.

        I added the Fancybox CSS to the template CSS file I built. All the Fancybox images are inside my template images folder and the CSS points to them OK. I used the same method when doing the Thickbox script.

        The only reason I am reaching for the Fancybox over the Thickbox is that the Fancybox has more appealing flourishes like the cool transitions, navigation images and nicer looking style overall.

        It might be the best way of figuring this out will be posting the site on a live server. Right now I am doing the rest of the site CSS, creating graphics and other content. If it comes to it I can launch this site when I am ready and then get the Fancybox working before I upload the real gallery images. I need to resize all the gallery images anyway...
          • 23299
          • 1,161 Posts
          One other thing I have noticed.

          I just checked the contents of the Fancybox folder I downloaded. There are no subfolders in this folder just the scripts, images and the CSS file. There is also a Thumbs.db file. This I have not done anything with. Could this be it? I did a get info on it and it says its a Unix Executable FIle...
            • 7923
            • 4,213 Posts
            Thumbs.db is a file what Windows Explorer does to cache thumbnails from image files.. you don’t need it.

            Yes, best way to get it resolved is to put the site online. Also be sure to check Javascript error logs from your browser always when working with js and having problems..


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 7231
              • 4,205 Posts
              I thought the Fancybox needed the noConflict added?
              Only to work with QuickEdit active since QE loads MooTools. Otherwise it is not needed wink
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 23299
                • 1,161 Posts
                I disabled QuickEdit...
                  • 23299
                  • 1,161 Posts
                  OK, I finally got this working...

                  After so much cutting and pasting and messing around I dumped that template and started again, I checked the paths to the JS and then checked the order of the script calls and it worked! At this stage I am going to follow the "if it ain’t broke don’t fix it."

                  Shane and Doze, I really, really appreciate all your tips, and patience here.

                  I really like the Fancybox script. It works great, looks really clean (sort of Mac like) and plays nicely with the JQuery navigation system I am using. Right now I feel like a kid who get to eat his own cake...

                  Lots more CSS work still to do...

                  Max
                    • 23299
                    • 1,161 Posts
                    I finally got around to uploading this to a real server...

                    You can read about the site here: http://modxcms.com/forums/index.php/topic,31879.0.html

                    or check out the URL at http://www.seattlerealestatephotography.com/

                    Thanks again for all the help with my fumbling around getting the script to work...

                    Max
                      • 23299
                      • 1,161 Posts
                      One more thing...

                      I would like to add the overlay effect to Fancybox (makes the rest of the page go darker while viewing the images.)

                      I guess the default is ’overlayShow’: false. I need to switch this to "true." I am not sure how to add this and where though? I assume this needs to go in the head of the template I am using for the gallery page? Or do I edit the actual Fancybox jquery script itself?

                      Thanks