Log in

View Full Version : Implementing Jquery zoom within php



itskimical
10-01-2010, 03:05 PM
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.



<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!



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!

bluewalrus
10-01-2010, 03:14 PM
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



?>
<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 />.