SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Aug 2009
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Variable Question?

    Hi Chaps,

    Not sure about this one, so thought I'd ask. . . .

    I have a image gallery page where 4 thumbnail images:
    Code:
    <div class="image_thumb">
    		<ul>
    			<li><a href="Product_Large/Product_Large1.jpg"><img src="Product_Thumb/Product_Thumb1.jpg" alt="Product Item 1" /></a></li>
    		  <li><a href="Product_Large/Product_Large2.jpg"><img src="Product_Thumb/Product_Thumb2.jpg" alt="Product Item 2" /></a></li>
    		  <li><a href="Product_Large/Product_Large3.jpg"><img src="Product_Thumb/Product_Thumb3.jpg" alt="Product Item 3" /></a></li>
    		  <li><a href="Product_Large/Product_Large4.jpg"><img src="Product_Thumb/Product_Thumb4.jpg" alt="Product Item 4" /></a></li>
    		  </ul>
    	</div>
    are presented, and using jQuery and CSS a larger version of the image is presented in a div:

    Code:
    <div class="main_image">
        <a href="Product_Zoom/Product_Zoom1.jpg" class="jqzoom" title="Product Item 1"><img src="Product_Large/Product_Large1.jpg" alt="- Product_Large1" /></a>
          </div>
    Then I use the class="jqzoom" jQuery function to display a extra-large version of the image.

    The problem is that the <a href: ....> link for each picture is the (at the monet) same, the <img scr . . .> changes however, to show the correct large version of the image.

    My question is, is there some way PHP can change the value of Product_Zoom1.jpg in:
    <a href="Product_Zoom/Product_Zoom1.jpg" class="jqzoom" title="Product Item 1">
    once the link in the <div class="image_thumb"> ???

  2. #2
    SitePoint Zealot Jaanboy's Avatar
    Join Date
    Sep 2007
    Location
    UK
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Of course. You'll need to show a bit more code about how these links are generated though to make it easier to help.

  3. #3
    SitePoint Addict
    Join Date
    Aug 2009
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, basically I'm tyring to get a result like this:
    http://www.magictoolbox.com/magiczoom/
    at the moment, the main image changes once the thumbnail is clicked, but the zoom image does not.
    I donwloaded the source files for free here:
    http://www.mind-projects.it/projects/jqzoom/
    But I can't figure out how to get the A HREF to change.
    I'm not too clued up on jQuery, so was wondering, could I get the same result by some sort of onClick function, that updates an A HREF variable?


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
  •