Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: document.getElementByID for Feature Image Zoomer

  1. #1
    Join Date
    Dec 2011
    Location
    HKSAR
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default document.getElementByID for Feature Image Zoomer

    1) Script Title: document.getElementByID for image path

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

    3) Describe problem:

    I am not familiar with Javascript and DOM .

    I have a list of images in the HTML list between <ul><li>.....</li></ul>

    How can I make use of document.getElementByID to fetch the image path then pass this value to the "largetimage:" field?


  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    	$('#image1').addimagezoom({
    		zoomrange: [3, 10],
    		magnifiersize: [300,300],
    		magnifierpos: 'right',
    		cursorshade: true,
    		largeimage: document.getElementById('myimage').src //<-- No comma after last option!
            //or
    	   //	largeimage: document.getElementById('mylink').href //<-- No comma after last option!
    	})
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Dec 2011
    Location
    HKSAR
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Red face

    Quote Originally Posted by vwphillips View Post
    Code:
    		largeimage: document.getElementById('myimage').src //<-- No comma after last option!
            //or
    	   //	largeimage: document.getElementById('mylink').href //<-- No comma after last option!
    	})
    Thanks for your kindly reply, Philip!

    Could you please give me an example to define "myimage" of "mylink" in the <ul> or <li> tags?

    I am a stupid fool for Javascript.

  4. #4
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <ul>
    <li><img id="myimage" src="MyImage.jpg" /></li>
    <li><a id="mylink" href="MyImage.jpg" ></a></li>
    </ul>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  5. #5
    Join Date
    Dec 2011
    Location
    HKSAR
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by vwphillips View Post
    Code:
    <ul>
    <li><img id="myimage" src="MyImage.jpg" /></li>
    <li><a id="mylink" href="MyImage.jpg" ></a></li>
    </ul>
    Thanks for your reply Philips!

    Is that OK for multi <li> rows commonly use a same ID of either "myimage" or "mylink"?

    I tried this Feature Image Zoomer works with Carousel (A big picture above the thumbnail with rows of <li> images </li> ).

    When click a picture in this thumbnail <li> ...</li>, it is sent to the big picutre. Whenever mouse-over the big picutre, it will zoom. Can common use of the same ID be used for various images in the above thumbnail?

    DOM and javascript are to tricky to me. Sorry about my foolish.


  6. #6
    Join Date
    Dec 2011
    Location
    HKSAR
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hello, Philips!

    It seems that you have done this before

    http://www.dynamicdrive.com/forums/s...ad.php?t=66609

    Last edited by jscheuer1; 01-05-2012 at 06:34 PM. Reason: fix hijack link to point to dd version

  7. #7
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    I understand now

    do you want this modified so it pans on mousemove of the original image and do you want the cursorshade?
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  8. #8
    Join Date
    Dec 2011
    Location
    HKSAR
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by vwphillips View Post
    I understand now

    do you want this modified so it pans on mousemove of the original image and do you want the cursorshade?
    I am not sure what you see my expected effect, Phillips.

    I tried to make a list of images in Pan or Thumbnail in <li><img id=....</li> list. When I click one row of the <li> small image ...</li>. It will show as the big/large picture. Whenever mouse over the large/big picture, another bigger/larger Zoom picture pop-up as the same effect as "Feature Imager Zoomer".

    You last "master piece" is just zooming itself inside the large/big picture frame. That is the difference with your one verse my expected one.

    That's way for my case according the your "myimage" or "mylink" whether works fine if the "id" in the <li>...</li> can be the same value?


  9. #9
    Join Date
    Dec 2011
    Location
    HKSAR
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by vwphillips View Post
    I understand now

    do you want this modified so it pans on mousemove of the original image and do you want the cursorshade?
    Yes, you are right, Phillips!

    My expected effect is "cursorshade" for largeimage Addimagezoom.


  10. #10
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

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
  •