Results 1 to 5 of 5

Thread: lightbox v2.0

  1. #1
    Join Date
    Jun 2008
    Posts
    121
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default lightbox v2.0

    hi everyone

    i m using lightbox 2.0 and i want to shift close button from bottom position to top right corner of the image.

    http://www.dynamicdrive.com/dynamici...box2/index.htm

    how can i do it

    vineet

  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

    In lightbox.js find (around line 298):

    Code:
    		var objImageDataContainer = document.createElement("div");
    		objImageDataContainer.setAttribute('id','imageDataContainer');
    		objLightbox.appendChild(objImageDataContainer);
    move it to here (around line 244):

    Code:
    Link)/.test(clickObj)) {
    				myLightbox.end();
    			}
    		};
    		objBody.appendChild(objLightbox);
    			
    		var objImageDataContainer = document.createElement("div");
    		objImageDataContainer.setAttribute('id','imageDataContainer');
    		objLightbox.appendChild(objImageDataContainer);
    
    		var objOuterImageContainer = document.createElement("div");
    		objOuterImageContainer.setAtt
    In the lightbox css, you will want to change things to suit for the imageData stuff, but one pretty much given is for the:

    Code:
    #imageData #bottomNavClose{ width: 66px; float: right;  padding-top: 0.7em;	}
    changing the padding-bottom to padding-top, as shown.

    One other thing you may want to do in lightbox.js is to disable the animation, it doesn't look as good with that section on the top (starting around line 60):

    Code:
    // -----------------------------------------------------------------------------------
    
    //
    //	Configuration
    //
    var fileLoadingImage = "file://localhost/C:/webwork2/test/lightbox203/images/loading.gif";		
    var fileBottomNavCloseImage = "file://localhost/C:/webwork2/test/lightbox203/images/closelabel.gif";
    
    var overlayOpacity = 0.8;	// controls transparency of shadow overlay
    
    var animate = true;			// toggles resizing animations
    var resizeSpeed = 7;		// controls the speed of the image resizing animations (1=slowest and 10=fastest)
    
    var borderSize = 10;		//if you adjust the padding in the CSS, you will need to update this variable
    
    // -----------------------------------------------------------------------------------
    Set it to false;
    - John
    ________________________

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

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    vineet (06-21-2008)

  4. #3
    Join Date
    Jun 2008
    Posts
    121
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default lightbox v2

    thanks. your solution worked for me.

    but if i change the animation to false then the script doesnt work and the image doesnt loads. so i m keeping it to true.

    vineet

  5. #4
    Join Date
    Jun 2008
    Posts
    121
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    thanks. your solution worked for me.

    but if i change the animation to false then the script doesnt work and the image doesnt loads. so i m keeping it to true.

    vineet

  6. #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

    Works here with false. Be sure to enter the information correctly, it should look like so:

    Code:
    var animate = false;			// toggles resizing animations
    - 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
  •