Results 1 to 2 of 2

Thread: Implementing Jquery zoom within php

  1. #1
    Join Date
    Oct 2010
    Posts
    18
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Lightbulb Implementing Jquery zoom within php

    I am trying to implement a image zoom within a PHP document. Here is what I am trying to achieve:

    http://www.professorcloud.com/mainsite/cloud-zoom.htm

    and here is what I am working with:

    I have two images - one the thumbnail the other the one is the large image

    Thumbnail = $display_smimage
    Large = $display_lgimage

    This is the HTML code that I am to insert - transfering it to PHP is where I get caught up.

    Code:
    <a href='/images/zoomengine/bigimage00.jpg' class = 'cloud-zoom' id='zoom1'
    rel="adjustX: 10, adjustY:-4">
    <img src="/images/zoomengine/smallimage.jpg" alt='' title="Optional title display" />
    </a>
    Here is what I have done so far that has not worked!

    Code:
    echo "<a class=\"cloud-zoom\" id=\"zoom1\" href=$display_lgimage1";
    echo "$display_smimage1</a>";
    I am not sure what to do with the rel="adjustX: 10, adjustY:-4"............so I left them out!

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    PHP Code:
    echo "<a class=\"cloud-zoom\" id=\"zoom1\" href=\"$display_lgimage1\" rel=\"adjustX: 10, adjustY:-4\">$display_smimage1</a>"
    Try that if it was working before you added the php in.

    or even

    PHP Code:
    ?>
    <a class="cloud-zoom" id="zoom1" href="<?php echo $display_lgimage1?>" rel="adjustX: 10, adjustY:-4"><?php echo $display_smimage1 ?></a>
    <?php
    //if more php below
    This assumes your js works perfect and your $display_smimage1 contains the full image tag (<img src="path_to_image" anything else needed />.
    Last edited by bluewalrus; 10-01-2010 at 03:20 PM.
    Corrections to my coding/thoughts welcome.

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

    itskimical (11-05-2010)

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
  •