zoukankan      html  css  js  c++  java
  • iframe 与简单的 tab

    <script type="text/javascript">
            $().ready(function () {
                $(function () {
                    $("#tabUl li:first").addClass("active");
                    $("#tabUlb div:gt(0)").hide();
                    $("#tabUl li").click(function () {
                        $(this).addClass("active").siblings("li").removeClass();
                        $(".tab div.tab_content:eq(" + $(this).index() + ")").show().siblings("div").hide();
                    });
                });
            });  
        </script>

    <style>

     .tab #tabUl, li { margin:0px; padding:0px; list-style:none; text-align:left;}    
     .tab #tabUl li { display: inline-block; zoom: 1; *display: inline;  color:#444; text-align:center; padding:1px 10px; cursor:pointer;border-bottom:solid 3px #eee;}    
     .tab  #tabUl .active{ color:Red; border-bottom:solid 3px red;text-align:center; padding:1px 10px; cursor:pointer;}   
     .tab_content { text-align:left; padding-top:20px; }
     

    </style>

     <ul id="tabUl">
           
    <li>产品简介</li>

    <li>规格参数</li>

    <li>套装详情</li>

    <li>操作指南</li>

    </ul>

    <div class="tab_content"></div>

    <div class="tab_content"></div>

    <div class="tab_content"></div>

    <div class="tab_content"></div>

    </div>

      <iframe src="" id="Iframe" frameborder="0" scrolling="no" style="border:0px;100%;" onload="autoHeight();"></iframe>

    <script type="text/javascript">
        function autoHeight() {
            var iframe = document.getElementById("Iframe");
            if (iframe.Document) {//ie自有属性
                iframe.style.height = iframe.Document.documentElement.scrollHeight;
            } else if (iframe.contentDocument) {//ie,firefox,chrome,opera,safari
                iframe.height = iframe.contentDocument.body.offsetHeight;
            }
        }
    </script>

     $(function () {

            $("#Iframe").attr("src", "/products/X11.htm");

                      autoHeight();

            });
        })

  • 相关阅读:
    本地服务器能ping通,但是ssh及各种端口都访问不到---待整理
    查看端口
    【服务器防护】linux 如何查看防火墙是否开启
    linux查看与开启sshd服务
    Win7没有telnet怎么办
    oracle Database link 创建
    本地PC安装Centos 6.5 操作手册及遇到的问题
    ORA-28000账户被锁和解锁
    mysql update常见实例
    Java的Statement、PreparedStatement、PreparedStatement + 批处理 的区别
  • 原文地址:https://www.cnblogs.com/tangself/p/2585832.html
Copyright © 2011-2022 走看看