Not working in IE
Posted: 15 October 2007 08:42 AM   [ Ignore ]
Newbie
Rank
Total Posts:  1
Joined  2007-10-15

Hi,

I am using perl with CSS 2 level drop down menu.

but it works fine with mozilla but not with IE.

first time it loads but next time the drop down will not appear if mouse is moved over.

Here is the code:-

#!c:\perl\bin\perl.exe

use CGI;

use 
CGI qw(:standard);

print 
header;

@
arr=('1.1234567','2.9876543');

foreach 
$ar(@arr)
{

print<<HTML;

<
style type="text/css">

#cssdropdown, #cssdropdown ul {
padding0;
margin0;
list-
stylenone;
}

#cssdropdown li {
floatleft;
positionrelative;
}

.mainitems{
border
1px solid black;
background-color#FFEEC6;
}

.mainitems a{
margin
-left6px;
margin-right8px;
text-decorationnone;
}

.subuls{
display
none;
width10em;
positionabsolute;
top1.2em;
left0;
background-colorlightyellow;
border1px solid black;
}

.subuls li{
width
100%;
}

.subuls li a{
text
-decorationunderline;
}

#cssdropdown li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the 

containing lirather than bottom left */
topauto;
leftauto;
}

#cssdropdown li:hover ul, li.over ul { /* lists nested under hovered list items */
displayblock;
}

#restofcontent { /*wrap rest of content of the page inside this div*/
clearleft;
}

</style>

<!--
//--><![CDATA[//><!--
startList = function() {
if (document.all&&document;.getElementById{
cssdropdownRoot 
document.getElementById("cssdropdown");
for (
x=0x<cssdropdownRoot.childNodes.lengthx++) {
node 
cssdropdownRoot.childNodes[x];
if (
node.nodeName=="LI"{
node
.onmouseover=function() {
this
.className+=" over";
}
node
.onmouseout=function() {
this
.className=this.className.replace(" over""");
}
}
}
}
}

if (window.attachEvent)
window.attachEvent("onload"startList)
else
window.onload=startList;

//--><!]]>
<ul id="cssdropdown">

<
li class="mainitems">
<
a href="http://www.cssdrive.com">CSS Gallery</a>
<
ul class="subuls">
<
li><a href="">Gordon Mac</a></li>
<
li><a href="">Juiced Thoughts</a></li>
<
li><a href="">The Daily Flight</a></li>
<
li><a href="">GrapeFruit</a></li>
</
ul>
</
li>

<
li class="mainitems">
<
a href="http://www.cssdrive.com/index.php/examples/">CSS Examples</a>
<
ul class="subuls" style="width: 15em">
<
li><a href="">CSS2 Generated Content</a></li>
<
li><a href="">Custom scrollbar colors</a></li>
<
li><a href="">Markerless and "no indent" Lists</a></li>
</
ul>
</
li>

</
ul>
[size=6][/size]
<div id="restofcontent">
<
br />
"
</div>

HTML

pls help me in soiving this problem


with regards
Archana

Profile
 
 
Posted: 18 July 2010 09:01 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  13
Joined  2010-07-08

Just thought i’d add this for future users who have trouble with drop downs.  A generator that takes the pain out of creating it for simple sites:  purecssmenu [dot] com


============================================
tampa web design diabetes log

Profile
 
 
Posted: 19 July 2010 10:58 AM   [ Ignore ]   [ # 2 ]
Newbie
Avatar
Rank
Total Posts:  9
Joined  2010-07-19
veli - 11 July 2010 04:49 PM

and you can also add a little title text to the page, and the final, final HTML document will then look like this:

  <head>
  <meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” />
  <title>Untitled Document</title>
  <link type=“text/css” rel=“stylesheet” href=”<strong class=“highlight”>menu</strong>.css” >
  menu</strong>.js”>
  </head>
 
  <body>
  <h1 style=“text-align: center”>CSS SINGLE-LEVEL DROPDOWN <strong class=“highlight”>MENU</strong></h1>
  <h3 style=“text-align: center”>Courtesy of: Frank Jamison</h3>
  <div id=”<strong class=“highlight”>menu</strong>”>
    <ul id=“topMenu”>
      <li class=“topMenuLink”>< a href=”#”>Top Link 1</a>
      <ul class=“subMenu”>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 1-1</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 1-2</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 1-3</a></li>
      </ul>
      </li>
      <li class=“topMenuLink”>< a href=”#”>Top Link 2</a>
      <ul class=“subMenu”>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 2-1</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 2-2</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 2-3</a></li>
      </ul>
      </li>
      <li class=“topMenuLink”>< a href=”#”>Top Link 3</a>
      <ul class=“subMenu”>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 3-1</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 3-2</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 3-3</a></li>
      </ul>
      </li>
      <li class=“topMenuLink”>< a href=”#”>Top Link 4</a>
      <ul class=“subMenu”>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 4-1</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 4-2</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 4-3</a></li>
      </ul>
      </li>
      <li class=“topMenuLink”>< a href=”#” id=“lastMenu”>Top Link 5</a>
      <ul class=“subMenu” id=“last”>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 5-1</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 5-2</a></li>
        <li class=“subMenuLink”>< a href=”#”>Sub Link 5-3</a></li>
      </ul>
      </li>
    </ul>
  </div>
  </body>
</html>

———————————-
schamlippenverkleinerung | schamlippenkorrektur | facelifting | augenlidstraffung

 

And thats why your a senior member! I think i will adopt this menu in a few pipelined projects thanks great post.

Profile
 
 
Posted: 15 March 2011 02:24 AM   [ Ignore ]   [ # 3 ]
Sr. Member
RankRankRankRank
Total Posts:  139
Joined  2010-04-23

jQuery makes this all very easy. It’s something you should consider for next time.
_____________________________
Sudoku - Flash Game - Flash Game
Flash Game - xnxx - Flash Game

Profile
 
 
Posted: 22 March 2011 10:28 AM   [ Ignore ]   [ # 4 ]
Newbie
Avatar
Rank
Total Posts:  8
Joined  2011-03-17

IE is a bitch , i hope that version 9 is much better.

Profile
 
 
Posted: 29 March 2011 06:33 AM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  1
Joined  2010-09-06

Thanks for the example.


_____________________

K.Swaby
car gamesfishing gamesamazon couponsiphone cases

Profile
 
 
Posted: 29 March 2011 02:45 PM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  1
Joined  2011-03-29

Thank.

Profile