Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

dynamic links for swap main image?


brainlag

Recommended Posts

Posted

test images

 

I finally figured out how to get a mouseover to change the main image displayed in product_info, but I can seem to get the link to change to the swaped image in the "main image" location. Is this possible and can it be done dynamically?

 

I removed the "click to enlarge" from the main image, so it wouldn't cause confusion. If I can get the 'main image' link to change, then I will put it back.

Posted
test images

 

I finally figured out how to get a mouseover to change the main image displayed in product_info, but I can seem to get the link to change to the swaped image in the "main image" location. Is this possible and can it be done dynamically?

 

I removed the "click to enlarge" from the main image, so it wouldn't cause confusion. If I can get the 'main image' link to change, then I will put it back.

I think I understand what you're saying here... You want not only the image itself to change during mouseover, but also the image that's loaded when they click to enlarge, meaning you'll have to change the link being called when they click, right? If so, you can do it by wrapping that anchor tag in a span element, giving it a unique id property, and rewriting its contents during rollover as well, something like this:

 

<span id="imageLink"><a href="java script:popupWindow('http://www.parrotsurfshop.com/buy/smith-brixton-sunglasses-pi-143.html?image=0')"></span>

And then wherever you've got the function that handles your mouseover event to change out the image, add a step to the function like this:

 

var linkEl = document.getElementById("imageLink");

linkEl.innerHTML = '<a href="java script:popupWindow('http://www.parrotsurfshop.com/buy/smith-brixton-sunglasses-pi-143.html?image=' + imageValue)">';

Hope that helps :)

 

Richard.

Richard Lindsey

Posted

You perfectly understood what I was attempting to say!

 

And oh yes that helps!

 

I didn't even think about spanning. I'm sure it will take me a while to figure out, but I'll post back what's happening and how it's progressing.

  • 7 months later...
Posted
test images

 

I finally figured out how to get a mouseover to change the main image displayed in product_info, but I can seem to get the link to change to the swaped image in the "main image" location. Is this possible and can it be done dynamically?

 

I removed the "click to enlarge" from the main image, so it wouldn't cause confusion. If I can get the 'main image' link to change, then I will put it back.

 

 

Hi!

 

How you did that? Is there any contribution for this function where i can just roll over the colours to display the product?

 

 

Many Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...