jquery simple implementation of the mouse through the navigation bar to change the background image

Source: Internet
Author: User

  Mouse through the navigation bar to change the background image is very good-looking, here is a description of how to use jquery, interested friends can refer to the following

The code is as follows: <! 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> maintenance ...</title>  <style>  *{  margin:0;  padding:0; }  body{  text-align:center;  background:yellow; }  #container {  width:962px;  height:auto;  Background:url (b3.jpg);  margin:0px-auto; }  #head {  height:100px;  width:100%; }  .head_ul{  list-style:none;  margin-left:200px; }   Head_ul li{  float:left;  width:90px;  height:50px;  line-height:40px;  font-size :20px;  margin-top:40px;  Background:url (b1.png); } . Head_ul Li a{  text-decoration:none;& nbsp }    #main {  width:100%;  height:1500px; }  #left {  width:30%;  height:100%;  float:left; }  #right {  width:70%;  height:100%;  float:left; }  #clear {  clear:both; }  #foot {  height:100px;  width:100%; }    </style>  <script src= "Jquery-1.7.2.js" ></ script>  <script>  $ (function () {  $ (". Head_ul li"). Hover (function () {  $ (this). CSS (' Background ', ' url (b2.png) '); },function () {  $ (this). CSS (' background ', ' url (b1.png) '); } );  });    </script>  </head>  <body>  <div id= "container" >  <div id= "Head" >  <ul class= "Head_ul" >  <li><a href= "#" > Home </a></li>   <li><a href= "#" > Home </a></li>  <li><a href= "#" > Home </a></li >  <li><a href= "#" > Home </a></li>  <li><ahref= "#" > Home </a></li>  <li><a href= "#" > Home </a></li>  </ul>   </div>    <div id= "main" >  <div id= "left" ></div>  <div id= "right "></div>  <div id=" clear "></div>  </div>    <div id=" Foot ">< /div>  </div  </body>  </html>   
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.