English 中文(简体)
Jquery Dropdown 在IE8工作
原标题:Jquery Dropdown not working in IE8

Im使用以下文字,在一个地点横向减少菜单。 该公司在Datherine和Safari从事了不起的工作,但在IE8(调查)中却失败。 打算采取的行为是,如果在导航清单中将一小小块的主要菜单放在一边,则相应的子门槛将出现,而后半部分现有的任何子将消失。 然而,在IE8中,只有一件菜单能够显示其相应的子菜单(只有在与左边连接后,没有子母子的环节被 h除),因此无法控制CSS对连接的 h余效应。 。 参见

我在“Qu”中没有足够的经验来了解我为什么会遇到问题,因此我恳请圣克韦罗的好民帮助。 感谢!

(Edit: I m also running ie7.js on this particular page-- I don t know if that will effect anything or not, but I thought it would be worth mentioning)

$(document).ready(function() {
            $( .submenu ul ).hide(); //hide all submenus
                var msec = document.location.href; //get current  url
                var mshref = msec.split("/"); //trim URL to include only current section
                $( .submenu ul[class~= +mshref[3]+ ] ).show(); //show submenu belonginging to current section

            $( .topmenu a ).hover(function(){
                var msection = $(this).attr("href");
                var msechref = msection.split("/");
                if($( .submenu ul[class~= +msechref[3]+ ] ).length){ //if there s a submenu belonging to this section
                    $( .submenu ul ).hide();//hide all submenus
                    $( .submenu ul[class~= +msechref[3]+ ] ).show(); //show the submenu for the section being hovered over
                } 
                else
                {
                $( .submenu ul ).hide();//hide all submenus
                $( .submenu ul[class~= +mshref[3]+ ] ).show();//show submenu for current section
                }

            });
        });

这里是超文本。

        <nav><!-- top nav -->
    <div class="topmenu">
        <ul class="section_list">
<li><a class="active" href="http://test/">Home</a></li>
<li><a href="http://test/about/">About</a></li>
<li><a href="http://test/ministries/">ministries</a></li>
<li><a href="http://test/news/">news</a></li>

<li><a href="http://test/sermons/">sermons</a></li>
<li><a href="http://test/contact/">contact</a></li>
</ul>
    </div>      
    <div class="submenu">
        <ul class="category_list about">
<li><a href="http://test/about/?c=join-us">join us</a></li>
<li><a href="http://test/about/?c=our-beliefs">our beliefs</a></li>

<li><a href="http://test/about/?c=our-staff">our staff</a></li>
<li><a href="http://test/about/?c=services">services</a></li>
</ul>
        <ul class="category_list ministries">
<li><a href="http://test/ministries/?c=adults">adults</a></li>
<li><a href="http://test/ministries/?c=children">children</a></li>
<li><a href="http://test/ministries/?c=preschool">preschool</a></li>

<li><a href="http://test/ministries/?c=youth">youth</a></li>
</ul>
    </div>
</nav><!-- end of top nav -->
问题回答

EDIT - Can you try this instead of yours:

$(document).ready(function() {
  var root =  http://www.qualprnt.com/clients/fbcw/ , $submenu = $( .submenu ul );
  $submenu.hide();
  var current = location.href.replace(root,   ).split( / )[0];
  if(current !=   ) {
    $submenu.filter( .  + current).show();
  }
  $( .topmenu a ).mouseenter(function(){
    var section = this.href.replace(root,   ).split( / )[0];
    $submenu.hide();
    if(section !=   ) {
      $submenu.filter( .  + section).show();
    }
    else {
      if(current !=   ) {
        $submenu.filter( .  + current).show();
      }
    }
    return false;
  });
});

有了这一解决办法,在将网站移至原域后,你必须修改<代码>root。 让我知道它是否发挥作用。

I will not delete my old answer, maybe it ll be useful for someone else.

OLD ANSWER:

如果你愿意更换你的特别安全局和超文本,那么这一解决办法对你来说可能更好。

HTML:

<nav><!-- top nav -->
    <div class="topmenu">
        <ul class="section_list">
            <li><a class="active" href="http://test/">Home</a></li>
            <li><a href="http://test/about/">About</a>
                <ul class="category_list">
                    <li><a href="http://test/about/?c=join-us">join us</a></li>
                    <li><a href="http://test/about/?c=our-beliefs">our beliefs</a></li>
                    <li><a href="http://test/about/?c=our-staff">our staff</a></li>
                    <li><a href="http://test/about/?c=services">services</a></li>
                </ul>
            </li>
            <li><a href="http://test/ministries/">ministries</a>
                <ul class="category_list">
                    <li><a href="http://test/ministries/?c=adults">adults</a></li>
                    <li><a href="http://test/ministries/?c=children">children</a></li>
                    <li><a href="http://test/ministries/?c=preschool">preschool</a></li>
                    <li><a href="http://test/ministries/?c=youth">youth</a></li>
                </ul>
            </li>
            <li><a href="http://test/news/">news</a></li>
            <li><a href="http://test/sermons/">sermons</a></li>
            <li><a href="http://test/contact/">contact</a></li>
        </ul>
    </div>      
</nav><!-- end of top nav -->

Javascript:

$(document).ready(function() {
    $( .section_list > li ).hover(
        function() {
            var $this = $(this);
            if($this.has( ul )) {
                $this.find( ul ).show();
            }
        },
        function() {
            var $this = $(this);
            if($this.has( ul )) {
                $this.find( ul ).hide();
            }
        }
    );
});

改变你的文字标签:

<script>

纽约总部

<script type="text/javascript">




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签