PDA

View Full Version : Expert needed.. problem with <a href coding



wyattb
Aug 12th, 2007, 09:00 PM
Hey there all

I am in need of some help and would be really grateful if one of you coders out there could answer this problem.

Basically here it is; im using a mouse scroll function to scroll through images in an array placing them in different cells of a table. Additionally im scrolling though an array of URLs so the images or Linked.

The important section of coding looks like the following...




{var html="<a href='"+urls[(x+cc)%5]+"'><img src='"+images[(x+cc)%5]+"' width='220'" + "height='150' border='0' /></a>";
document.getElementById("cell_"+x).innerHTML = html;



What i want to do is have the Linked pages as Pop up windows for which the < a href code looks like.



<a href="prod4.html" onClick="wopen('prod4.html'); return false;">



So what i need to do is link the two codes together, which is where i am having trouble.

What i think it should like like is..



{var html="<a href= ' ' onclick=wopen'(urls[(x+cc)%5])'; return false;"><img src='"+images[(x+cc)%5]+"' width='220'" + "height='150' border='0' /></a>";
document.getElementById("cell_"+x).innerHTML = html;


But this doesn't work it only refreshes the page..

So again i would really appreciate it any of you could help me out.

Ben

_Aerospace_Eng_
Aug 12th, 2007, 09:09 PM
{var html="<a href='"+urls[(x+cc)%5]+"' onclick='wopen(this.href);return false'><img src='"+images[(x+cc)%5]+"' width='220'" + "height='150' border='0' /></a>";
document.getElementById("cell_"+x).innerHTML = html;
That should work.

wyattb
Aug 13th, 2007, 02:20 PM
Aerospace Eng.

Thank you so much that worked perfectly, i've been trying to get that working for an absolute age. You are a supreme coder.

Ben