Results 1 to 5 of 5

Thread: FrogJS Image Gallery - code for continuous loop?

  1. #1
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question FrogJS Image Gallery - code for continuous loop?

    1) Script Title: FrogJS Image Gallery

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ogjs/index.htm

    3) Describe problem: does anyone know the code to have this gallery go around in a continuous loop rather than stop at the end and have to go back though in the other direction as it presently does. Cheers

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Make the following addtions (red):

    Code:
    		 . . . Thumb2.style.left = '0';
    		ribbit.appendChild(lThumb2);
    		//-----------------------------------------
    		// End Inserting new elements
    		//-----------------------------------------
    		
    		// Preloads first image and displays image along with next thumbnail
    		var myFrog = this; // IE can't use the global `myFrog` until it's been initialized
    		var imgPreloader = new Image();
    		imgPreloader.onload=function(){
    			myFrog.loadMainImage(0, imgPreloader.width);
    			myFrog.thumbIn(1, 'right');
    			myFrog.thumbIn(imageArray.length-1, 'left');
    		}
    		imgPreloader.src = imageArray[0]['full'];
    	},
    These four all add the same line of code in four different spots:

    Code:
    	// thumbIn()
    	// Loads in new thumbnail and preloads image if neccessary
    	thumbIn: function(imageNum, side){
    		Element.hide('FrogJS'+side+'Thumb1');
    		var imageNum=imageArray[imageNum]? imageNum : imageNum < 0? imageArray.length+imageNum : imageNum-imageArray.length;
    		if(imageArray[imageNum]){
    			Element.setCur . . .
    Code:
    	// thumbOut()
    	// Removes old thumbnail
    	thumbOut: function(imageNum, side){
    		var imageNum=imageArray[imageNum]? imageNum : imageNum < 0? imageArray.length+imageNum : imageNum-imageArray.length;
    		if(imageArray[imageNum]){
    			$('FrogJS'+sid . . .
    Code:
    	// mainIn()
    	// Fades thumbnail into main image
    	mainIn: function(imageNum, side){
    		var imageNum=imageArray[imageNum]? imageNum : imageNum < 0? imageArray.length+imageNum : imageNum-imageArray.length;
    		$('FrogJS'+side+'Thumb2').src = imageArray[imageNum]['thumb'];
    		Element.removeDime . . .
    Code:
    	// mainOut()
    	// Fades old main image into thumbnail
    	mainOut: function(imageNum, side){
    		Element.hide('FrogJS'+side+'Thumb1');
    		var imageNum=imageArray[imageNum]? imageNum : imageNum < 0? imageArray.length+imageNum : imageNum-imageArray.length;
    		if(imageArray[imageNum]){
    			Element.setC . . .
    This might be a little bit of overkill, but worked in testing.
    Last edited by jscheuer1; 12-03-2007 at 10:00 AM. Reason: simplify
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Awesome, thanks John that works beautifully.

  4. #4
    Join Date
    Feb 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default what about the Cmotion gallery?

    Does anyone have any idea on how to accomplish the same thing with the CMotion gallery?

    Thanks

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Please post a new thread for a new question.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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