如何在jquery中隐藏基础选项卡

时间:2015-01-28 00:08:55

标签: javascript jquery

大家好我不得不尽快推出网站,但我需要在课程中隐藏标签,以便学生不会通过此代码看到评分分配标签。所以我试图选择研究表答案键和分级作业答案键的标签代表部分:

       Panels-->
    <dl class="tabs" data-tab>
    <dd class="active"><a href="#p1a">Study Sheets</a></dd>
    <dd><a href="#p1b">Study Sheets Answer Keys</a></dd>
    <dd><a href="#p1c">Graded Assignments</a></dd>
    <dd><a href="#p1d">Graded Assignment Answer Keys</a></dd>
  </dl>
  <div class="tabs-content">
    <div class="content active" id="p1a">
          <ul class="ss">
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Study/CCAlg1S1StudyU1.PDF">Study Sheet Unit One</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Study/CCAlg1S1StudyU2.PDF">Study Sheet Unit Two</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Study/CCAlg1S1StudyU3.PDF">Study Sheet Unit Three</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Study/CCAlg1S1StudyU4.PDF">Study Sheet Unit Four</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Study/CCAlg1S1StudyU5.PDF">Study Sheet Unit Five</a></li>
          </ul>
    </div>
    <div class="content" id="p1b">
      <ul class="ssa">
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1StudyKey/CCAlg1S1StudyKeyU1.PDF">Study Sheet w/ Answers Unit One</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1StudyKey/CCAlg1S1StudyKeyU2.PDF">Study Sheet w/ Answers Unit Two</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1StudyKey/CCAlg1S1StudyKeyU3.PDF">Study Sheet w/ Answers Unit Three</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1StudyKey/CCAlg1S1StudyKeyU4.PDF">Study Sheet w/ Answers Unit Four</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1StudyKey/CCAlg1S1StudyKeyU5.PDF">Study Sheet w/ Answers Unit Five</a></li>
          </ul>
    </div>
    <div class="content" id="p1c">
      <ul class="ga">
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Graded/CCAlg1S1GradedU1.PDF">Graded Assignment Unit One</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Graded/CCAlg1S1GradedU2.PDF">Graded Assignment Unit Two</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Graded/CCAlg1S1GradedU3.PDF">Graded Assignment Unit Three</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Graded/CCAlg1S1GradedU4.PDF">Graded Assignment Unit Four</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1Graded/CCAlg1S1GradedU5.PDF">Graded Assignment Unit Five</a></li>
     </ul>
    </div>
    <div class="content" id="p1d">
      <ul class="gaa">
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1GradedKey/CCAlg1S1GradedKeyU1.PDF">Graded Assignment w/ Answers Unit One</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1GradedKey/CCAlg1S1GradedKeyU2.PDF">Graded Assignment w/ Answers Unit Two</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1GradedKey/CCAlg1S1GradedKeyU3.PDF">Graded Assignment w/ Answers Unit Three</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1GradedKey/CCAlg1S1GradedKeyU4.PDF">Graded Assignment w/ Answers Unit Four</a></li>
          <li><a href="/paperWork/Math/CCAlgebra1Sem1/CCAlgebra1Sem1GradedKey/CCAlg1S1GradedKeyU5.PDF">Graded Assignment w/ Answers Unit Five</a></li>
          </ul>
    </div>
  </div>       
        </div>  
    </dd>
    </dl>

现在我试图用类ssa和gaa选择标签,我的js就像:

$(document).ready(function(){
    $("ul>.gaa").hide();
    $("ul>.saa").hide();
   }

我尝试过其他一些变化,但似乎没有任何效果。我可以删除部分但我想使用js。谢谢朋友们。

1 个答案:

答案 0 :(得分:2)

// ----错误的类声明。

(文档)$。就绪(函数(){

$("ul>.gaa").hide();

$("ul>.saa").hide();

}

// ----我认为这是正确的代码。我希望它有用!

(文档)$。就绪(函数($){

$(".content ul.gaa").hide();

$(".content ul.saa").hide();

}