用 CSS 來控制:
創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供迭部網(wǎng)站建設、迭部做網(wǎng)站、迭部網(wǎng)站設計、迭部網(wǎng)站制作等企業(yè)網(wǎng)站建設、網(wǎng)頁設計與制作、迭部企業(yè)網(wǎng)站模板建站服務,十多年迭部做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡服務。
*?{
cursor:?url('路徑'),?auto;
}
三點要對新手說的,第一這個路徑是相對于你這個 CSS 的路徑的;第二是要想所有瀏覽器(IE8之前的直接PASS)都支持,格式需要為 ?cur 或者 ico 的;第三尺寸最好是 32*32 的。
!DOCTYPE html
html
head
meta charset="utf-8" /
script type="text/javascript" src="jquery-1.7.2.min.js"/script
style type="text/css"
*{
margin: 0;
padding: 0;
}
.hbody{
margin-left: 25%;
}
.show{
margin-left: 160px;
width: 200px;
height: 200px;
border: 1px solid #EEEEEE;
}
.show img{
width: 200px;
height: 200px;
}
.tab{
border: 1px solid #eee;
width: 535px;
height:100px ;
}
.tab img{
border: 1px solid #eee;
width: 100px;
height: 100px;
cursor: pointer;
}
/style
/head
body
div class="hbody"
div class="show"
img /
/div
div class="tab"
img src="1.jpg" /
img src="2.jpg" /
img src="3.jpg" /
img src="4.jpg" /
img src="5.jpg" /
/div
/div
/body
script
$(function(){
var Src = $('.tab').find('img').eq(0).attr('src');
$('.show').find('img').attr('src',Src)
})
$('.tab').find('img').mouseover(function(){
var inx = $(this).index();
var Imgsrc = $('.tab').find('img').eq(inx).attr('src');
$('.show').find('img').attr('src',Imgsrc)
})
/script
/html
引一個jquery文件,圖片地址替換一下就可以了
html中有一個標簽,直接給文字添加一個a標簽 ;\x0d\x0a比如:\x0d\x0a關于我們\x0d\x0aa標簽默認的鼠標放上去就是一個手指的樣式,或者你也可以用cursor: pointer;這個給他設置一下,cursor還有其他的屬性可以使用
獲取你鼠標點擊位置的left與top值,然后更改角色圖片的left與top值。通過getElementById獲取角色圖片元素。照葫蘆畫瓢知道嗎?你參考參考超級瑪麗是怎么做的。超級瑪麗是根據(jù)“→”鍵位控制圖片,其實就是更改了原來圖片的top與left值。同理,你只要得到鼠標點擊部位的top與left值,那么再傳給角色,角色就會移動過去。建議參考超級瑪麗 javascript代碼,
標題名稱:html5鼠標,HTML5鼠標經(jīng)過顯示內(nèi)容
網(wǎng)頁路徑:http://chinadenli.net/article24/dsiiije.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、搜索引擎優(yōu)化、域名注冊、企業(yè)建站、云服務器、網(wǎng)站設計
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)