圖片放大方法、、捲軸位置隨滾輪移動固定方法、、<a></a>去外層虛線方法:a:focus { outline:none; -moz-outline:none;};

來源:互聯網
上載者:User

標籤:

圖片放大方法:

<style type="text/css">
.xt{ width:230px; height:230px;}
.tp{ width:230px; height:230px; overflow:hidden;}
.tp img{transition:all 1s ease-out 0s; margin-left:0px; margin-top:0px; perspective-origin:bottom;}
</style>

 

<body>

<div class="tp">
  <img class="xt" onmouseover="Bian(this)" onmouseout="Hui(this)" src="c320_20160923147459793296513.jpg"/>
</div>


</body>

 

<script type="text/javascript">
function Bian(a)
  {
    a.style.marginTop = "-10px";
    a.style.marginLeft = "-10px";
    a.style.height=" 260px";
    a.style.width= "260px";

  }
function Hui(a)
  {
    a.style.height=" 230px";
    a.style.width= "230px";
    a.style.marginTop = "0px";
    a.style.marginLeft = "0px";
}
</script>

捲軸位置隨滾輪移動固定方法:

<style type="text/css">

.t{ width:990px; height:80px; background-color:#F00; font-size:23px;}

</style>

<body>

<div style="width:100%; height:80px; background-color:#000; position:fixed;"></div>

<div style="width:200px; height:300px; background-color:#00F;"></div>

<div class="t"></div>

<div style="width:800px; height:1000px; background-color:#09F;"></div>

</body>

 

<script type="text/javascript">

$(document).ready(function(e)
{
  var off=$(".t").offset();  //擷取DIV離頂部的距離
  var of=off.top-160;  //DIV離頂部的距離-本身DIV高度加頂部DIV高度的總高
  $(window).scroll(function()
    {
      var scr=$(window).scrollTop();  //擷取捲軸Y軸距離
        if(scr>of)
          {
            $(".t").css("position","fixed");
            $(".t").css("top","80px");  //根據需要調整
            $(".t").css("background-color","#906");   //根據需要調整
            $(".t").css("left","275px");  //根據需要調整
            $(".t").css("width","800px");  //根據需要調整
            $(".t").css("height","60px");  //根據需要調整

          }
        if(scr<of)
          {
            $(".t").css("position","absolute");
            $(".t").css("top","230px");   //根據需要調整
            $(".t").css("background-color","#F00");   //根據需要調整
            $(".t").css("left","180px");  //根據需要調整
            $(".t").css("width","990px");  //根據需要調整
            $(".t").css("height","80px");  //根據需要調整
          }

    })
});

圖片放大方法、、捲軸位置隨滾輪移動固定方法、、<a></a>去外層虛線方法:a:focus { outline:none; -moz-outline:none;};

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.