Forum Moderators: open
Perhaps they had javascript turned off?
You can also do css rollovers, less code, work in all newer browsers.
If you have a particular issue, sometimes posting a detailed question will get helpful responses. Also the site search is useful.
//set variables for browser usage here and use as global
//basic ns4 test
isNS4=(document.layers? true : false);
// test for IE4
isIE4 = (document.all && !document.getElementById)? true : false;
// both IE5 and NS6 are DOM-compliant which is WC3 standard and future browser compliant
isDOM = (document.getElementById)? true : false;
//make purpose button hihglighted when page loads
if(isNS4){
document.images['purpose'].src = 'images/buttons/purpose_f2.gif';
}
if(isIE4){
document.images['purpose'].src = 'images/buttons/purpose_f2.gif';
}
if(isDOM){
document.getElementById("purpose").setAttribute('src', "images/buttons/purpose_f2.gif");
}I'm kind of stuck on this one - and i normally use basic css rolovers - often client wants sepcific font - futura in this case :(
if (document.images)
document.images['purpose'].src = 'images/buttons/purpose_f2.gif'
Of course, it's probably a part of the complete script that serves for some other things. But if it's just for rollovers, remove everything except what I wrote here. You just don't need all the rest.
Saw your site and your client is right . your buttons do send you where you want to go , but they dissapear the minute you click on them and you have to browse over to make them reappear again !
Windows 98, IE 5.00.2919.6307. Windows 2k
Pro, IE 5.00.2919.6307. WinXP pro Explorer 6.
function changeMenu(next){
var layers=chosen+"Layer";
if (chosen!="present") {
if (isNS4) {
document.layers[chosen+"Layer"].visibility = "hide"
}
if(isIE4){
document.all[chosen+"Layer"].style.visibility = "hidden";
}
if(isDOM){
document.getElementById(chosen+"Layer").style.visibility = 'hidden';
}
}
//need to hide scroller if chosen already
if (chosen=="present"){
hidePresent()
}
if (next!="present") {
if (isNS4) {
document.layers[next+"Layer"].visibility = "show"
}
if(isIE4){
document.all[next+"Layer"].style.visibility = "visible";
}
if(isDOM){
document.getElementById(next+"Layer").style.visibility = 'visible';
}
}
//show scroller if chosen
if (next=="present"){
showPresent();
}
//swap existing highlighted button back to original state
returnImage='images/buttons/'+chosen+'.gif';
if (isNS4) {
document.images[chosen].src = returnImage;
}
if(isIE4){
document.images[chosen].src = returnImage;
}
if(isDOM){
document.getElementById(chosen).setAttribute('src', returnImage);
}
//set new button to highlighted state
chosen=next;
replaceImage='images/buttons/'+chosen+'_f2.gif'
flip(chosen, replaceImage);
}and here is the code that sets it <a href="javascript:void(0)" onClick="javascript:changeMenu('purpose')" onMouseOut="restoreImage('purpose')" onMouseOver="swapImage('purpose'); return false;"> thanks for the input however your code will not swap an image in netscape 6.1 and greater
But, wow, what a lot of code for such a simple task. Somewhere on this board I posted my own ultra-compact JavaScript rollover code... Now, where is it...?