Hey Guy’s,
this is a wierd one. The for loop works on all the pseudo links except the first one?? I hope it’s a matter of [i-1] but can’t figure out how I’d write it.
This is the relevant js.
[CODE]
//appended to row
var additemlink=document.createElement(‘span’);
additemlink.setAttribute(‘title’,’Review this ‘+item+’, then click Continue Shopping to return.’);
additemlink.className=’itemlink’;
additemlink.onclick=function()
{
this.style.color=’red’;
this.setAttribute(‘title’,this.innerText+’, item just reviewed.’);
var eimg=document.getElementById(‘eimg’);
eimg.firstChild.src=ref;
eimg.style.display=’block’;
EvalSound1();
f2.className=’register’;
tablecontainer2.style.display=’block’;
invoice2.style.display=’block’;
this.parentNode.parentNode.scrollIntoView(false);
var itemlinks=document.getElementsByClassName(‘itemlink’);
for(var i=0;i<itemlinks.length;i++)
{
if(itemlinks[i] !== this )
{
itemlinks[i].setAttribute(‘title’,’Review this ‘+itemlinks[i].innerText+’, then click Continue Shopping to return.’);
itemlinks[i].style.color=’#2c3664′;
this.style.color=’red’;
this.setAttribute(‘title’,this.innerText+’, just reviewed.’);
}
}
};
additemlink.onmouseover=function()
{
var itemlinks=document.getElementsByClassName(‘itemlink’);
for(var i=0;i<itemlinks.length;i++)
{
if((this.style.color==’red’)&&(eimg.style.display==’block’))
{
this.setAttribute(‘title’,’Showing: ‘+this.innerText);
//I think itemlinks[i-1].setAttribute(‘title’,?????????
itemlinks[i].setAttribute(‘title’,’Review this item: ‘+itemlinks[i].innerText+’, then click Continue Shopping or Sub Total above to return.’);
}
if((this.style.color==’red’)&&(eimg.style.display==’none’))
{
this.setAttribute(‘title’,this.innerText+’, item just reviewed.’);
itemlinks[i].setAttribute(‘title’,’Review this item: ‘+itemlinks[i].innerText+’, then click Continue Shopping or Sub Total above to return.’);
}
}
};
Any help greatly appreciated. It works on all but the first one?