Results 1 to 3 of 3

Thread: How to get the first image zoomed on load?

  1. #1
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to get the first image zoomed on load?

    Hi I am using this image zoom gallery javascript from here:
    http://www.angnetwork.com/javag/1/

    It looks like the first image zoomed is of random order. Try to refresh the page many times and you will see the random order. In the javascript code I tried to find what made the random order behavior but did not succeed.

    I believe from line 320 "Diapo.prototype....." that controls the order but I couldn't find any clues about how to fix the first image, ct37.jpg, to get zoomed on load.

    Please help me solve this mystery, thanks alot in advance!

    P.S. You may just view the source of the above link to get all the javascript code.
    Last edited by Snookerman; 04-30-2009 at 11:01 AM. Reason: added “Resolved” prefix

  2. #2
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb solved..........

    Oh I just solved this myself:

    change this line:
    if (this.parent.view < 0) this.parent.view = 0;//this.N; // 0 for setting the first image to be zoomed on load

    Thanks anyway.

  3. #3
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb adding the keyboard arrow keys navigation....

    I also figured out how to add the keyboard arrow keys navigation.

    Add this lines of code
    Code:
    /* ==== keyboard right arrow & left arrow ==== */
    		this.oc.keydown = this.oc.onkeydown = function (e) {
    			if (e == null) { // ie            
    				keycode = event.keyCode;           
    			} else { // mozilla             
    				keycode = e.which;           
    			}
    			if (this.parent.view < this.parent.NF - 1 && keycode == 39)
    				this.parent.calc(1);
    			if (this.parent.view > 0 && keycode == 37)
    				this.parent.calc(-1);
    		}
    before this line of code
    Code:
    /* ==== right arrow ==== */
    Now you can use keyboard left and right arrow keys to navigate the images.

    Cheers!

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
  •