Hello.
I'm building a page that will show four bulletins on it.
For browsers that support JavaScript it will hide all but one, and choosing a link will make another visible. For those that don't support JavaScript it will use the anchor tag. The function returns false to cancel the anchor link.
For some reason the JavaScript will just not work in IE. I don't receive any errors, yet nothing changes. The anchor link doesn't even work - probably due to a default return value of FALSE for functions.
Here is the JavaScript I am using:
There is CSS defined for the divs in question - each is defined with a bottom border - except for the last one (used as a separator for non-javascript browsers).
Any idea on how to get this working in IE? If you need the CSS I can post that too.
BTW - I should mention I can only test on IE7 (upgraded XP machines, and Vista).
Thanks.
I'm building a page that will show four bulletins on it.
For browsers that support JavaScript it will hide all but one, and choosing a link will make another visible. For those that don't support JavaScript it will use the anchor tag. The function returns false to cancel the anchor link.
For some reason the JavaScript will just not work in IE. I don't receive any errors, yet nothing changes. The anchor link doesn't even work - probably due to a default return value of FALSE for functions.
Here is the JavaScript I am using:
Code:
function hideBulletin(index){
var doc = document.getElementById('bulletin_'+index);
if( doc != null ){
alert('changing: ' + index);
doc.style.display = 'none';
doc.style.border = '0';
}
}
function showBulletin(index){
//alert(index);
var i = 0;
for( i = 0; i < 4; i++ ){
hideBulletin(i);
}
var doc = document.getElementById('bulletin_'+index);
if( doc != null ){
doc.style.display = 'block';
}
return false;
}
function startBulletin(){
showBulletin(0);
}
function addLoadEvent(func) {
var oldonload = window.onload;
if(typeof window.onload != 'function'){
window.onload = func;
}else{
window.onload = function(){
if(oldonload){
oldonload();
}
func();
}
}
}
addLoadEvent(startBulletin);
There is CSS defined for the divs in question - each is defined with a bottom border - except for the last one (used as a separator for non-javascript browsers).
Any idea on how to get this working in IE? If you need the CSS I can post that too.
BTW - I should mention I can only test on IE7 (upgraded XP machines, and Vista).
Thanks.