Hello, I have a form containing an outline. This outline consist of a table and many rows and cells.
Here’s an example of a row ( or outline entry):



When I click on the link (the one that calls the function “redirectToURL”), I want to change a picture (folderC.gif) to another one (folderO.gif).
The code below works flawlessly with anything related to Mozilla (Nescape, FireFox, …)… but with Internet Explorer, the .src seems to be changed (if I do an alert afterward), but the image is not correctly shown. Only a blank is shown (white) instead of the image.
Can someone help? I tried everything.
Thanks!
Pascal
Here’s my code:
/* Change the style of both the last selected folder, and the currently selected folder */
function setStyle(oldObj, newObj) {
if (oldObj) {
oldObj.parentNode.previousSibling.previousSibling.src = ‘folderC.gif’;
oldObj.style.backgroundColor = ‘#ffffff’;
oldObj.style.color = ‘#000000’;
}
if (newObj) {
newObj.parentNode.previousSibling.previousSibling.src = ‘folderO.gif’;
newObj.style.backgroundColor = ‘#004080’;
newObj.style.color = ‘#ffffff’;
}
return true;
}
function getElements(evt) {
/* Cross-browser way of getting the event object */
evt = (evt)? evt : ((event)? event : null);
/* Cross-browser way of getting the active element object */
elem = (evt.target)? evt.target : evt.srcElement;
/* Only care about A elements… */
if (elem.tagName == ‘A’) {
/* … that are “folders” */
if (elem.href.indexOf(‘redirectToURL’)!= -1) {
var obj = document.getElementById(idPrevious);
/* Change the style of the previous/current selected folder */
setStyle(obj, elem);
}
}
document.onclick = getElements;