Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 3.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-24-2010, 11:19 PM   PM User | #1
pmpurser
New to the CF scene

 
Join Date: Jul 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
pmpurser is an unknown quantity at this point
JS Drop Down Menu, GetElementById, & Cross-Browser Issues

I have been working for days it seems, trying to resolve many issues with a js drop down menu. I am attempting to place a hyperlinked image into a js drop down menu and have been successful in firefox, but I cannot seem to hyperlink the image in ie, saf, chr, and opera. The website's location is http://crescentcay.com/04_index.html and I'll list the code below. By clicking on 'location' in drop down under the nav bar's 'welcome' a new flash movie is inserted by the getelementbyid function. It seems that the hyperlink is all that changes from browser to browser, and again, this works for me in firefox but not in any other browser. Thanks for your help in advanced.

function mopen(subCat){
window.clearTimeout();
var identifier;
var subCat;
if (subCat = '0'){
identifier = 'sddm';
}
else if (subCat = '1'){
identifier = 'sddm_alt';
}
subCat = typeof(subCat) == "undefined" ? "" : subCat;
var mopen=new Array()
mopen[0]= '<div id="locale"><a href="javascript:menu(6)" target="_top" onClick="javascript:bt_alt_loc(0)" onMouseOver="javascript:bt_alt_loc(0);javascript:mcancelclosetime();" onMouseOut="javascript:bt_alt_loc(1);javascript:mclosetime();"><img src="images/buttons_02_a_up.jpg" alt="Location" name="Home" width="75" height="35" border="0" onload=""></a></div>'
mopen[1]= '<div id="locale"><a href="javascript:menu(6)" target="_top" onClick="javascript:bt_alt_loc(0)" onMouseOver="javascript:bt_alt_loc(0);javascript:mcancelclosetime();" onMouseOut="javascript:bt_alt_loc(1);javascript:mclosetime();"><img src="images/buttons_02_a_up.jpg" alt="Location" name="Home" width="75" height="35" border="0" onload=""></a></div>'
document.getElementById(identifier).innerHTML = mopen[subCat];
}

function bt_alt_loc(bt_lc_a){
var bt_lc_a;
var bt_lc_a_b;
var bt_desc;
if (bt_lc_a = '0'){
bt_lc_a_b = '1';
bt_desc = 'dn';
}
else if (bt_lc_a = '1'){
bt_lc_a_b = '0';
bt_desc = 'up';
}
document.getElementById("locale").innerHTML = '<div id="locale"><a href="javascript:menu(6)" target="_top" onClick="javascript:bt_alt_loc(' + bt_lc_a + ')" onMouseOver="javascript:bt_alt_loc(' + bt_lc_a + ');javascript:mcancelclosetime();" onMouseOut="javascript:bt_alt_loc(' + bt_lc_a_b + ');javascript:mclosetime();"><img src="images/buttons_02_a_' + bt_desc + '.jpg" alt="Location" name="Home" width="75" height="35" border="0" onload=""></a></div>'
}

function mclose(){
document.getElementById("sddm").innerHTML = ''
}

var closetimer = 0;

function mclosetime(){
closetimer = window.setTimeout(mclose, 500);
}

function mcancelclosetime(){
if(closetimer){
window.clearTimeout(closetimer);
closetimer = null;
}
}
pmpurser is offline   Reply With Quote
Reply

Bookmarks

Tags
browser, getelementbyid, hyperlink, js drop down menu

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:37 PM.


Advertisement
Log in to turn off these ads.