/    Sign up×
Community /Pin to ProfileBookmark

suckerfish menu IE?

Hi,

q1)I did a suckerfish menu copied and altered from the hot dog site. It works in FF but not in IE as all i get is the links but no dropdown as in FireFox. I really hate this when IE fails . I put all the css/JS between the head tag.

q2)I can’t move the menu to the right without problems as i set a margin on #headlinks2 and the links get cluttered?

#headlinks2 {
height:25px;
}

#headlinks2 a {
color:green;

display: block;
text-decoration:none;
width: 100px;
font-size:13pt;
padding-right:5px;
//margin-left:205px;
}

#headlinks2 a:hover {
color: white;

}

#headlinks2, #headlinks2 ul {
padding: 0;
margin: 0;
list-style: none;
}

#headlinks2 li {
float: left;
width: 100px;
}

#headlinks2 li ul {
position: absolute;
width: 100px;
left: -999em;
}

#headlinks2 li:hover ul {
left: auto;

}

#headlinks2 li:hover ul, #headlinks2 li.sfhover ul {
left: auto;

}
</style>
<script type=”text/javascript”>
sfHover = function() {
var sfEls = document.getElementById(“nav”).getElementsByTagName(“LI”);
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=” sfhover”;
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(” sfhoverb”), “”);
}
}
}
if (window.attachEvent) window.attachEvent(“onload”, sfHover);

</script>

//html

<div id=”headlinks2″>

<li><a href=”#”>Percoidei</a>
<ul>
<li><a href=”#”>Remoras</a></li>
<li><a href=”#”>Tilefishes</a></li>
<li><a href=”#”>Bluefishes</a></li>

</ul>
</li>

<li><a href=”#”>Anabant</a>
<ul>
<li><a href=”#”>Climbing perches</a></li>
<li><a href=”#”>Labyrinthfishes</a></li>
<li><a href=”#”>mex</a></li>

</ul>
</li>

<li><a href=”#”>Percoidei</a>
<ul>
<li><a href=”#”>Remoras</a></li>
<li><a href=”#”>Tilefishes</a></li>
<li><a href=”#”>Bluefishes</a></li>

</ul>
</li>
<li><a href=”#”>Anabant</a>
<ul>
<li><a href=”#”>Climbing perches</a></li>
<li><a href=”#”>Labyrinthfishes</a></li>
<li><a href=”#”>mex</a></li>

</ul>
</li>

<li><a href=”#”>Percoidei</a>
<ul>
<li><a href=”#”>Remoras</a></li>
<li><a href=”#”>Tilefishes</a></li>
<li><a href=”#”>Bluefishes</a></li>

</ul>
</li>
<!– etc. –>

</div>

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@KDLAMar 13.2007 — IE isn't failing. Your coding is incorrect, causing the javascript (on which IE relies because it does not support li:hover) not to function.

You are missing the first <ul> tag in your code. It should be named "nav," or replace the name "nav" in your javascript with "headlinks2" or whatever div name you want.

<ul id="headlinks2"> or change the "nav" to "headlinks" in the javascript
Copy linkTweet thisAlerts:
@jagguyauthorMar 14.2007 — Hi,

I actually changed all this before posting so that isn't a problem.

What i want to do is just move the menu to the right and do i use float:right as that fails or do i use a margin/padding as this only moves part of it?
×

Success!

Help @jagguy 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.20,
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,
)...