WordPress jQuery 菜单

发布于 2024-11-10 05:57:16 字数 3131 浏览 0 评论 0原文

您好,我正在我的网站上工作,

我希望将此导航菜单转换为 jQuery 菜单,因为它在 Internet Explorer 中不起作用:

如您所知,wordprees 使用嵌套列表作为其菜单。

困境是我不知道从哪里开始创建脚本,如果一个项目悬停,例如。

if $(".ul li").hover() then $(.ul ul).show()

这是我需要排序的菜单列表`

 <div id="n" class="nav">
  <div class="menu">
   <ul>
   <li class="page_item page-item-5 current_page_item">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/" title="Home">Home
    </a>
   </li>
   <li class="page_item page-item-2">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/about/" title="Our Services">Our Services
    </a>
     <ul class='children'>
      <li class="page_item page-item-16">
       <a href="http://www.webcarepreview.co.uk/mandalandscaping/about/maintenance/" title="Maintenance">Maintenance
       </a>
      </li>
      <li class="page_item page-item-125">
       <a href="http://www.webcarepreview.co.uk/mandalandscaping/about/nidagravel/" title="Nidagravel">Nidagravel
       </a>
      </li>
      <li class="page_item page-item-213">
       <a href="http://www.webcarepreview.co.uk/mandalandscaping/about/timber-tech/" title="Timber Tech">Timber Tech
       </a>
      </li>
     </ul>
    </li>
    <li class="page_item page-item-7">
     <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/" title="Galleries">Galleries
     </a>
      <ul class='children'>
       <li class="page_item page-item-76">
        <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/garden-1/" title="Garden 1">Garden 1
        </a>
       </li>
       <li class="page_item page-item-104">
        <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/garden-2/" title="Garden 2">Garden 2
       </a>
     </li>
     <li class="page_item page-item-134">
      <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/garden-3/" title="Garden 3">Garden 3
      </a>
     </li>
     <li class="page_item page-item-209">
      <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/decking/" title="Garden 4">Garden 4
      </a>
     </li>
    </ul>
   </li>
   <li class="page_item page-item-10">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/watch-video/" title="Project Videos">Project Videos
    </a>
   </li>
   <li class="page_item page-item-8">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/staff-profile/" title="About Us">About Us
    </a>
   </li>
   <li class="page_item page-item-6">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/contact/" title="Contact">Contact
   </a>
  </li>
 </ul>
</div>
    </div>
</div>

有人可以帮我吗? 非常感谢。

hi there im working on my web site

I'm looking to turn this navagation menu into a jQuery menu because it does not work in Internet Explorer:

As you know wordprees uses nested lists for its menu .

The dilema is i dont know where to start do I create the script that if an item hovers eg.

if $(".ul li").hover() then $(.ul ul).show()

here is the menu list that i need sorted `

 <div id="n" class="nav">
  <div class="menu">
   <ul>
   <li class="page_item page-item-5 current_page_item">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/" title="Home">Home
    </a>
   </li>
   <li class="page_item page-item-2">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/about/" title="Our Services">Our Services
    </a>
     <ul class='children'>
      <li class="page_item page-item-16">
       <a href="http://www.webcarepreview.co.uk/mandalandscaping/about/maintenance/" title="Maintenance">Maintenance
       </a>
      </li>
      <li class="page_item page-item-125">
       <a href="http://www.webcarepreview.co.uk/mandalandscaping/about/nidagravel/" title="Nidagravel">Nidagravel
       </a>
      </li>
      <li class="page_item page-item-213">
       <a href="http://www.webcarepreview.co.uk/mandalandscaping/about/timber-tech/" title="Timber Tech">Timber Tech
       </a>
      </li>
     </ul>
    </li>
    <li class="page_item page-item-7">
     <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/" title="Galleries">Galleries
     </a>
      <ul class='children'>
       <li class="page_item page-item-76">
        <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/garden-1/" title="Garden 1">Garden 1
        </a>
       </li>
       <li class="page_item page-item-104">
        <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/garden-2/" title="Garden 2">Garden 2
       </a>
     </li>
     <li class="page_item page-item-134">
      <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/garden-3/" title="Garden 3">Garden 3
      </a>
     </li>
     <li class="page_item page-item-209">
      <a href="http://www.webcarepreview.co.uk/mandalandscaping/galleries/decking/" title="Garden 4">Garden 4
      </a>
     </li>
    </ul>
   </li>
   <li class="page_item page-item-10">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/watch-video/" title="Project Videos">Project Videos
    </a>
   </li>
   <li class="page_item page-item-8">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/staff-profile/" title="About Us">About Us
    </a>
   </li>
   <li class="page_item page-item-6">
    <a href="http://www.webcarepreview.co.uk/mandalandscaping/contact/" title="Contact">Contact
   </a>
  </li>
 </ul>
</div>
    </div>
</div>

Can someone help me with this?
Many thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

無心 2024-11-17 05:57:18

也许这段代码可以提供帮助。

jQuery(function(){

   jQuery("li").hover(function(){

      var ul = jQuery(this).parent();
      ul.show();

   });

});

maybe this code can help.

jQuery(function(){

   jQuery("li").hover(function(){

      var ul = jQuery(this).parent();
      ul.show();

   });

});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文