Results 1 to 4 of 4

Thread: Lightbox Viewer from 2 different Hyperlinks ??

  1. #1
    Join Date
    Aug 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Lightbox Viewer from 2 different Hyperlinks ??

    Script: Lightbox Image Viewer 2.0
    http://www.dynamicdrive.com/dynamici...box2/index.htm

    Hello,

    Could you please help me with the following problem:

    I would like to link to the Lightbox Viewer from 2 different hyperlinks on the same page.

    On my gallery page, I have a Thumbnail image which is hyperlinked to open the Lightbox viewer, and I would also like to have Text in my menu hyperlink to the same viewer.

    Problem is, I linked both the thumbnail and the text to open the same first image of the gallery, and the viewer displayed the first image TWICE. Once at the beginning of the gallery and once at the end.

    Is it possible to have one of the links just point to a gallery, or make it image-less?

    Thanks,
    Allan
    Last edited by whitewolf; 12-22-2006 at 08:53 PM.

  2. #2
    Join Date
    Aug 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    C'mon guys, anyone, please ?

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,127
    Thanks
    44
    Thanked 3,228 Times in 3,189 Posts
    Blog Entries
    12

    Default

    Without seeing your page I cannot be sure if this will do it but, from the looks of what you are describing it will. It has helped get rid of duplicate images in other non-standard lightbox 2.0 implementations. OK, look for this in the lightbox.js file (around line 118):

    Code:
    // -----------------------------------------------------------------------------------
    
    //
    //	Extending built-in Array object
    //	- array.removeDuplicates()
    //	- array.empty()
    //
    Array.prototype.removeDuplicates = function () {
    	for(i = 1; i < this.length; i++){
    		if(this[i][0] == this[i-1][0]){
    			this.splice(i,1);
    		}
    	}
    }
    Change it to this:

    Code:
    // -----------------------------------------------------------------------------------
    
    //
    //	Extending built-in Array object
    //	- array.removeDuplicates()
    //	- array.empty()
    //
    Array.prototype.removeDuplicates = function () {
    	for(i = 0; i < this.length; i++){
    	for (var i_tem = 0; i_tem < this.length; i_tem++)
    		if(this[i][0] == this[i_tem][0]&&i!==i_tem){
    			this.splice(i_tem,1);
    		}
    	}
    }
    If this doesn't work for you, perhaps you are linking to two identical image files with different names or there could be another problem.
    - John
    ________________________

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

  4. #4
    Join Date
    Aug 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking Thanks

    John,

    Thank you so much, it's solved the problem.

    Here's a link to the gallery in question, please visit the museum:

    http://www.allanmoon.com/gallery.html

    DYNAMIC DRIVE forum rules !

    Thanks again,
    Allan


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
  •