2

This is working fine In Firefox if I use it in fixed bar or IN GENERAL WAY, BUT in Internet Explorer it does not works in fixed bar.. here I am putting the code without the fixed bar...please try it in fixed bar for IE9

This is html and css for the code for the code...

jquery required: jquery.min.js and dropscript.js is below

<html>
<head>
<title>Submenu Demo</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/dropscript.js"></script>
<link href="css/style.css" rel="stylesheet" type="text/css"/>


</head>
<body>
    <div style='margin:50px'>

    <div class="dropdown">
    <a class="account" >
    <span>My Account</span>
    </a>
    <div class="submenu" style="display: none; ">

      <ul class="root">
<li >
          <a href="#Dashboard" >Dashboard</a>
        </li>


        <li >
          <a href="#Profile" >Profile</a>
        </li>
       <li >

          <a href="#settings">Settings</a>
        </li>


        <li>
          <a href="#feedback">Send Feedback</a>
        </li>



        <li>
          <a href="#signout">Sign Out</a>
        </li>
      </ul>
    </div>
    </div>

    </div>
</body>
</html>

css:
body
{
    background-color:#505050;

    }

.dropdown {
color: #555;
margin: 3px -22px 0 0;
width: 143px;
position: relative;
height: 17px;
text-align:left;
}
.submenu
{
background: #fff;
position: absolute;
top: -12px;
left: -20px;
z-index: 100;
width: 135px;
display: none;
margin-left: 10px;
padding: 40px 0 5px;
border-radius: 6px;
-moz-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
-webkit-box-shadow:0 2px 8px rgba(0, 0, 0, 0.45);
/* For IE 8 */
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');

}

.dropdown  li a {

    color: #555555;
    display: block;
    font-family: arial;
    font-weight: bold;
    padding: 6px 15px;
    cursor: pointer;
    text-decoration:none;
    display:block;
    zoom:1;
}



.dropdown li a:hover{
    background:#155FB0;
    color: #FFFFFF;
    text-decoration: none;
    display:block;
    zoom:1;

}
.account {
font-size: 11px;
line-height: 16px;
color: #555;
position: absolute;
z-index: 110;
display: block;
padding: 11px 0 0 20px;
height: 28px;
width: 121px;
margin: -11px 0 0 -10px;
text-decoration: none;
background: url(../icons/arrow.png) 116px 17px no-repeat;
cursor:pointer;
}
.root
{
list-style:none;
margin:0px;
padding:0px;
font-size: 11px;
padding: 11px 0 0 0px;
border-top:1px solid #dedede;


}
$(document).ready(function()
{
$(".account").click(function()
{
var X=$(this).attr('id');

if(X==1)
{
$(".submenu").hide();
$(this).attr('id', '0');    
}
else
{

$(".submenu").show();
$(this).attr('id', '1');
}

});

//Mouseup textarea false
$(".submenu").mouseup(function()
{
return false
});
$(".account").mouseup(function()
{
return false
});



//Textarea without editing.
$(document).mouseup(function()
{
$(".submenu").hide();
$(".account").attr('id', '');
});

});// JavaScript Document

On troubleshooting More I get this... The issue is because of the navigation Bar I am using below it but still the issue persist...

The navigation bar html

 <div class="container_2" style="margin-top:40px;"> 
    <div class="container">
        <div id="dropnav" style=" width:100%;">
        <ul>
    <li><a href="userLandingPage.php">Home</a></li>
    <li ><a href="about.php">About us</a></li>
    <li ><a href="why_we.php">Why Us</a></li>
    <li ><a href="Competition_Info.php">Competitions Info </a>

    </li>
    <li><a href="courses.php?<?php echo $courses->id; ?>">Courses</a></li>
    <li ><a href="aptitude_tool.php">Prep Tool</a></li>
    <li><a href="mock_Test.php">Mock Test</a></li>
    <li ><a href="targetgk.php">Target GK</a></li>
    <li ><a href="RBI_Special.php">RBI Spl<span class="drop"></span></a></li>
    <li ><a href="aptitudeOfDay.php">Apti QOD<span class="drop"></span></a></li>
    <li ><a href="newsupdates.php">News Updates<span class="drop"></span></a></li>
    <li><a href="faq.php">FAQ</a></li>
    <li><a href="#">Blog</a></li>


  </ul>


</div>

The css for the navigation is as below:

        @charset "utf-8";
.dropdown {
color: #555;
margin: 3px -22px 0 0;
width: 143px;
position: relative;
height: 17px;
text-align:left;
}
.submenu
{
background: #fff;
-moz-box-background: #fff;
-webkit-box-background:#fff;
position: absolute;
top: -12px;
left: -20px;
z-index: 100;
width: 135px;
display: none;
margin-left: 10px;
padding: 40px 0 5px;
border-radius: 6px;
-moz-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
-webkit-box-shadow:0 2px 8px rgba(0, 0, 0, 0.45);
/* For IE 8 */
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');



}

.submenu ul li a {
 color: #555555;
    display: block;
    font-family: arial;
    font-weight: bold;
    padding: 6px 15px;
    cursor: pointer;
    text-decoration:none;
    display:block;
    zoom:1;
}

.submenu ul li a:hover{
    background:#155FB0;
    color: #FFFFFF;
    text-decoration: none;

}
.account {
font-size: 11px; !important
line-height: 16px;
color: #555;
position: absolute;
z-index: 110;
display: block;
padding: 11px 0 0 20px;
height: 28px;
width: 121px;
margin: -11px 0 0 -10px;
text-decoration: none;
background: url(../icons/arrow.png) 116px 17px no-repeat;
cursor:pointer;
}
.root
{
list-style:none;
margin:0px;
padding:0px;
font-size: 11px;
padding: 11px 0 0 0px;
border-top:1px solid #dedede;


}
.container_2{ width:100%; float:left; z-index:99;
 background-color:#333;
 height:auto;
 margin-top:10px;
 }
/* CSS Document */
4

1 回答 1

1

嗯,问题在于 IE... 真的很糟糕。感觉它缺少 Chrome 和 Firefox 所具有的功能。我已经在 IE 9 中完成了一些东西,只是其中的基本内容,它不会运行。这很奇怪,只是屁股疼。当我在 Firefox 中运行时,它运行良好。它主要只是一个小论坛,对 6 种不同的输入进行基本计算。这可能是一个原因。它只是对编码的翻译不好。即使是现代的基本代码,您也必须找到一种方法来解决 IE 9 的问题。

于 2013-05-17T03:15:50.123 回答