jquery - slidedown 没有按预期方式工作

标签 jquery html css

我对 html、jquery 和 css 非常陌生。我正在尝试创建一个导航栏,当我单击该导航栏时,它将打开一个 jquery slidedown,但它没有按预期方式工作。下面是我为此目的编写的一小部分代码

      html: 
            <ul class="dropdown">
        <li id="cl1"><a class="ab" href="#">About </a></li >
            </ul>
      css:
            <div class="target" style="z-    
                  index:3;width:1000px;height:1000px;display:none;background-    
                  color:white;opacity:0.8;position:fixed;top:0px;left:0px;">                                   
             <img src="horse.jpg" alt="horse" />
            </div>
      jquery:
                $(document).ready(function() {

               $(".ab").click(function(){
                  $(".target").slideDown( 'slow', function());
                });
               });


            there are more sub menus to the above html

最佳答案

$(".ab").click(function(){
    $(".target").slideDown( 'slow', function(){});
});

您忘记在函数中添加引号 {}

关于jquery - slidedown 没有按预期方式工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21969609/

相关文章:

jquery - 如何使用 CSS 使输入字段的行为类似于单击按钮?

javascript - bgStretcher 插件 - 多个实例

css - 在 CSS 中选择包含 A span 的 TD

jquery - 通过API将颜色样式设置为tinyMCE文本选择

javascript - Chrome 和 Google 网络字体的问题。显示来自 Firefox 的不同输出

jquery - 使用 jQuery 在 COLUMN 中搜索表行以查找特定文本

html - 如何在wordpress主题中注册html页面的CSS

jquery - 用 Jest 模拟 jquery $.ajax

javascript - 将 SVG 标记从 HTML 页面保存到 SVG 图像

html - 在我的例子中,垂直对齐 div 中的文本