开发者

menu collapsing javascript not working in IE8

开发者 https://www.devze.com 2023-03-31 12:46 出处:网络
I am using a menu collapsing javascript in my wesite in which when i click in the title called member the list of members must be shown down the member as accordion.In firefox and chrome it is working

I am using a menu collapsing javascript in my wesite in which when i click in the title called member the list of members must be shown down the member as accordion.In firefox and chrome it is working quite well but when i tested with IE8 all the members are showing before clicking the member title.Can some one help me is this a browser compatibility issue or something else.Hope i will get the answer soon.

This is the function which is in the js page. //menu-collapsed.js

<script type="text/javascript">
function initMenu() {
  $('#menu ul').hide();
  $('#menu li a').click(
    function() {
        $(this).next().slideToggle('normal');   
      }
    );
  }
$(document).ready(function() {initMenu();});
</script>

and the html page is:

<html>
<head>
<script src="includes/jquery-1.2.1.min.js" type="text/javascript"></script>
<script src="includes/menu-collapsed.js" type="text/javascript"></script>
 <script type="text/javascript">
//<![CDATA[
var page={};

$(function() {
new FrontPage().init();
});

//]]>
</script>
</head>
<开发者_运维知识库;body>
<ul id="menu">  
    <li>
    <?php
        $mvo=new menuVO();
        $mdao=new menuDAO();
        $menus=$mdao->fetchAll('onlypublished');
            foreach($menus as $menu)
            {
                if($menu->menu_type=='Member')
                {
                    echo "<a href=\"#\">$menu->name</a>"; 
                }
            }


        $mvo=new membersVO();
        $mdao=new membersDAO();
        $list=$mdao->fetchAll('onlypublished');
        echo "<ul>";    
            foreach($list as $members)
            {
                echo "<li><span><a href=\"$members->url\">$members->name</a></span></li>";
            }
        echo "</ul>";   
    ?>
        </li>
</ul>
</body>
</html>


Put up your code. You may also find your answer trying to learn how to make one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号