链接到其他网页的特定标签html

时间:2016-11-24 01:14:02

标签: javascript html5

我有两个HTML。 第一个HTML,我有这个:(只有链接)

<!DOCTYPE html>
<html>
<head>
<title>index</title>
 <script src="js/jquery.js"></script>       
</head>
<body>
<a href="tabs.html#tab3" >link tab3</a>
<br>
<a href="tabs.html#tab5">link tab5</a>          
</body>
</html>
  • 和第二个html,我有点击。

                          标签                                            TAB1                     TAB2                      TAB3                     TAB4                      tab5                      tab6                           

                                                
             
                 

    TAB1

                 

    Lorem ipsum dolor坐下来,精神恍惚。 Molestiae,fugit,et ab omnis obcaecati temporibus beatae nobis nostrum odit accusantium numquam ex deleniti animi voluptates officiis explicabo ipsa iusto eius!

                    

       <div id="tab2" class="tab-grid2">    
        <h3>tab2</h3>
             <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, fugit, et ab omnis obcaecati temporibus beatae nobis nostrum odit accusantium numquam ex deleniti animi voluptates officiis explicabo ipsa iusto eius!</p> 
              </div> <!-- /.tab2 --> 
    
               <div id="tab3" class="tab-grid3">    
               <h3>tab3</h3>
             <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, fugit, et ab omnis obcaecati temporibus beatae nobis nostrum odit accusantium numquam ex deleniti animi voluptates officiis explicabo ipsa iusto eius!</p> 
             </div> <!-- /.tab3 -->        
    
               <div id="tab4" class="tab-grid4">
               <h3>tab4</h3>
             <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, fugit, et ab omnis obcaecati temporibus beatae nobis nostrum odit accusantium numquam ex deleniti animi voluptates officiis explicabo ipsa iusto eius!</p> 
             </div> <!-- /.tab4 -->     
    
               <div id="tab5" class="tab-grid5">    
                  <h3>tab5</h3>
             <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, fugit, et ab omnis obcaecati temporibus beatae nobis nostrum odit accusantium numquam ex deleniti animi voluptates officiis explicabo ipsa iusto eius!</p>
             </div> <!-- /.tab5 --> 
    
             <div id="tab6" class="tab-grid6">
             <h3>tab6</h3>
             <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, fugit, et ab omnis obcaecati temporibus beatae nobis nostrum odit accusantium numquam ex deleniti animi voluptates officiis explicabo ipsa iusto eius!</p>
             </div> <!-- /.tab7 --> 
    
        <!-- jQuery-->  
         <script src="jquery.js"></script>
    
            <script>
            $(document).ready(function() {
                $("#tab2").hide();
                $("#tab3").hide();
                $("#tab4").hide();
                $("#tab5").hide();
                $("#tab6").hide();
                $("#tab7").hide();
                $(".tabs-menu a").click(function(event){
                    event.preventDefault();
                    var tab=$(this).attr("href");
                    $(".tab-grid1,.tab-grid2,.tab-grid3,.tab-grid4,.tab-grid5,.tab-grid6,.tab-grid7").not(tab).css("display","none");
                    $(tab).fadeIn("slow");
                });
                $("ul.tabs-menu li a").click(function(){
                    $(this).parent().addClass("active a");
                    $(this).parent().siblings().removeClass("active a");
                });
            });
            </script>
    </body>
    

如何将我发送到特定标签,例如标签#3,因为总是将我发送到标签#1

0 个答案:

没有答案