/    Sign up×
Community /Pin to ProfileBookmark

Making my code Mozilla Friendly

Hi

On my site, I have a menu which uses JavaScript and CSS as outlined below.
Unfortunately this code is not Mozilla friendly – how would I go about making it Mozailla friendly?

<style type=”text/css”>

#ddimagetabs{
}
#ddimagetabs a{
display : block;
text-decoration: none;
font: 8pt Arial; /*tab font */
background-color: #FF6600; /*background color */
color: #000099; /*font color */
width: 68px; /*width of tab image */
height: 25px; /*height of tab image */
float: left;
display: inline;
margin-left: 4px; /*spacing between tabs */
padding-top: 4px; /*vertical offset of tab text from top of tab*/
background-image:url(bluetab.jpg); /*URL to tab image */
background-repeat: no-repeat;
text-align: center;
}

#ddimagetabs a:hover, #ddimagetabs a.current{
background-image:url(bluetabover.jpg); /*URL to tab image onmouseover */
background-color: #000099;
color: #FFFFFF;
}

#tabcontentcontainer{
width:380px; /*width of 2nd level content*/
height:40px; /*height of 2nd level content. Set to largest’s content height to avoid jittering.*/
}

.tabcontent{
display:none;
}

</style>

<script type=”text/javascript”>

var initialtab=[1, “sc1”]
var turntosingle=0 //0 for no (default), 1 for yes
var disabletablinks=0 //0 for no (default), 1 for yes
var previoustab=””

if (turntosingle==1)
document.write(‘<style type=”text/css>n#tabcontentcontainer{display: none;}n</style>’)

function expandcontent(cid, aobject){
if (disabletablinks==1)
aobject.onclick=new Function(“return false”)
if (document.getElementById && turntosingle==0){
highlighttab(aobject)
if (previoustab!=””)
document.getElementById(previoustab).style.display=”none”
document.getElementById(cid).style.display=”block”
previoustab=cid
}
}

function highlighttab(aobject){
if (typeof tabobjlinks==”undefined”)
collectddimagetabs()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].className=””
aobject.className=”current”
}

function collectddimagetabs(){
var tabobj=document.getElementById(“ddimagetabs”)
tabobjlinks=tabobj.getElementsByTagName(“A”)
}

function do_onload(){
collectddimagetabs()
expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}

if (window.addEventListener)
window.addEventListener(“load”, do_onload, false)
else if (window.attachEvent)
window.attachEvent(“onload”, do_onload)
else if (document.getElementById)
window.onload=do_onload
</script>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@intriviousNov 08.2006 — That is a lot to look at.

I once read a quote saying this, and I have never done differently:

"Design for Firefox, and then make your hacks that are necessary for IE."

So true...
×

Success!

Help @kathrync2003 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...