日期:2014-05-17  浏览次数:20444 次

页面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>

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>