DejaVu Posted October 29, 2007 Posted October 29, 2007 I've found a replacement script I want to use on my site for the Image previews instead of the run of the mill popup. If this is possible, I'll add a write up as to how to do it, but I first need some assistance fromsomeone who doesnt get confused by coding (Not Me, LOL!!) Firstly, In product_info.php I found the popup script - <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> All I wish to do is remove THAT completely and implement what is needed into this - <a class='expand_a' onclick='imagezoom(this, "http://url.to/full.size.image")'> <img src="http://url.to/thumbnail.image" class='expand_img' /> </a> I realise the URL's in the thumbnail is the same. But I cant work out how to parse the code correctly, can someone have a go before I give myself headache. Thanks in advance.
DejaVu Posted October 29, 2007 Author Posted October 29, 2007 Can anyone understand what I'm trying to do here? The original popup script I want to replace with this - http://cre.ations.net/blog/post/the-dhtml-...-zooming-script
DejaVu Posted October 29, 2007 Author Posted October 29, 2007 Been working on this for hours now and just cannot seem to get it right. All I really need is the Image URL's from product_info.php put into the correct place. Can someone have a look and let me know how to parse this? It cant be too difficult is it?
♥toyicebear Posted October 29, 2007 Posted October 29, 2007 Click here Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here]
Nullachtfuffzehn Posted October 29, 2007 Posted October 29, 2007 <?php echo '<a class="expand_a" onclick="imagezoom(this, "'. tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '")">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5" class="expand_img"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
DejaVu Posted October 29, 2007 Author Posted October 29, 2007 Thats awesome, not quite the one I was after. But still pretty good nonetheless. Thanks toyicebear. That will give me some more insight iton how to do it! :)
Guest Posted October 29, 2007 Posted October 29, 2007 Click here Is there a demo available anywhere of this in action?
DejaVu Posted October 29, 2007 Author Posted October 29, 2007 There is now! http://www.ticklesticks.co.uk
DejaVu Posted October 29, 2007 Author Posted October 29, 2007 <?php echo '<a class="expand_a" onclick="imagezoom(this, "'. tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '")">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5" class="expand_img"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> Not to sure what the problem is, but it's complaining of a syntax error.
Nullachtfuffzehn Posted October 29, 2007 Posted October 29, 2007 <?php echo '<a class="expand_a" onclick="imagezoom(this, '. tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . ')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5" class="expand_img"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
DejaVu Posted October 29, 2007 Author Posted October 29, 2007 Still recieving an error. It's says Error - Expected ')' In IE6 Although, viewing the source it does appear correct... <a class="expand_a" onclick="imagezoom(this, http://www.ticklesticks.co.uk/images/08531.jpg)"><img src="images/08531.jpg" border="0" alt="" title="" width="100" height="80" hspace="5" vspace="5" class="expand_img"><br>Click to enlarge</a><noscript> <a href="http://www.ticklesticks.co.uk/images/08531.jpg" target="_blank"><img src="images/08531.jpg" border="0" alt="" title="" width="100" height="80" hspace="5" vspace="5"><br>Click to enlarge</a></noscript> I have removed the alts from the images as they are inappropriate ! LOL
Nullachtfuffzehn Posted October 29, 2007 Posted October 29, 2007 I don't get an error at all. Works fine for me.
DejaVu Posted October 31, 2007 Author Posted October 31, 2007 I don't get an error at all. Works fine for me. I swapped the versions over! I currently have 2 working on the site. This is a prefab one made by some here on OSCommerce (Controlled by CSS) - http://www.ticklesticks.co.uk/product_info...products_id=864 This is the one I'm trying to get working exactly the same as THIS EXAMPLE. http://www.ticklesticks.co.uk/product_info...products_id=864 It Dynamically zooms towards you onscreen. Notice product_info2.php (the above link is shortened by the forum, check your status bar) this is the one I'm trying to get sorted. If you view the source, it's exactly the same as it's ment to be though (I could be wrong!). Sorry, I should have said this before my previous post! Doh!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.