首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

页面js代码没执行

2013-06-19 
页面js代码没有执行 script$(#narrowBy h2).each(function () {$(this).click(function () {$(this).t

页面js代码没有执行
 <script>
     $("#narrowBy h2").each(function () {
         $(this).click(function () {
             $(this).toggleClass('down').next('.options-wrap').children('.options').slideToggle('fast').next().toggle();
             $(this).next('.options-wrap').css('paddingBottom', $(this).hasClass('down') ? 0 : 9);
         });
     });
     
     $("#narrowBy p a:not(.more)").click(function () {
         $(this).toggleClass("nsSelected");
     });
</script>

页面js代码没执行 JavaScript
[解决办法]

<script type="text/javascript">
        $(document).ready(function () {
$(this).click(function () {
              $(this).toggleClass('down').next('.options-wrap').children('.options').slideToggle('fast').next().toggle();
              $(this).next('.options-wrap').css('paddingBottom', $(this).hasClass('down') ? 0 : 9);
          });
      });
      
      $("#narrowBy p a:not(.more)").click(function () {
          $(this).toggleClass("nsSelected");
      });
 </script>

[解决办法]
错了
<script type="text/javascript">
        $(document).ready(function () {
$(“#narrowBy h2“).click(function () {
              $(this).toggleClass('down').next('.options-wrap').children('.options').slideToggle('fast').next().toggle();
              $(this).next('.options-wrap').css('paddingBottom', $(this).hasClass('down') ? 0 : 9);
          });
      });
       
      $("#narrowBy p a:not(.more)").click(function () {
          $(this).toggleClass("nsSelected");
      });
 </script>

热点排行