js寫當滑鼠懸浮及移開出現背景變化

來源:互聯網
上載者:User

標籤:1.0   ant   mouse   ansi   document   visible   url   變化   cti   

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>xuanting</title><style type="text/css">#a{    background-image:url(image/index-lhd-1-2880x1480.jpg);    background-size:1000px 500px;    background-position:center;        width:1000px;    height:500px;    border:1px solid #000;    position:relative;    top:100px;    margin:auto;    overflow:hidden;    cursor:pointer;}/*#a:hover{        background-size:1200px 600px;    background-position:center;    transition:0.7S;    cursor:pointer;}*/#b{    width:300px;    height:25px;    position:relative;    top:400px;    margin:auto;    font-family:"微軟雅黑";    font-size:18px;    text-align:center;    overflow:hidden;    cursor:pointer;        }    </style></head><body><div id="a" onmouseout="yi()" onmouseover="fu()"><div id="b" onmouseout="yi()" onmouseover="fu()"><span>2017雷克薩斯全球設計大獎</span><br /><span>旨在為新銳設計師們提供機會</span><br /><br /><span>查看詳情&nbsp;&nbsp;&nbsp;></span></div></div></body></html><script>function yi(){    document.getElementById("a").style.backgroundSize="1000px 500px";    document.getElementById("a").style.transition="0.7s";    document.getElementById("b").style.transition="0.7s";    document.getElementById("b").style.overflow="hidden";}function fu(){    document.getElementById("a").style.backgroundSize="1200px 600px";    document.getElementById("a").style.backgroundPosition="center";    document.getElementById("a").style.transition="0.7s";    document.getElementById("a").style.cursor="pointer";    document.getElementById("b").style.transition="2s";    document.getElementById("b").style.cursor="pointer";    document.getElementById("b").style.overflow="visible";}</script>

 

js寫當滑鼠懸浮及移開出現背景變化

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.