




版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
【移動應用開發(fā)技術】jquery怎么實現(xiàn)京東側(cè)邊欄導航效果
這篇文章主要介紹“jquery怎么實現(xiàn)京東側(cè)邊欄導航效果”的相關知識,在下通過實際案例向大家展示操作過程,操作方法簡單快捷,實用性強,希望這篇“jquery怎么實現(xiàn)京東側(cè)邊欄導航效果”文章能幫助大家解決問題。樣式代碼<style>
*{
padding:
0;
margin:
0;
border:
0;
}
body{
height:
2000px;
}
.right_ng{
width:
40px;
height:
100%;
position:
absolute;
position:
fixed;
right:
0px;
background:
#666666;
}
.sign{
width:
40px;
height:
40px;
margin-top:280%;
}
.sign_top{
margin-top:
10px;
}
.sign_add_height{
height:
140px;
background:
#888888;
color:
#ffffff;
font-size:
13px;
list-style:
none;
font-weight:
bold;
}
.sign_add_height
ul{
margin-top:
6px;
cursor:
pointer;
}
.sign_add_height
ul
li{
list-style-type:
none;
width:
20px;
height:
20px;
margin-top:
5px;
}
.buy{
width:
20px;
height:
20px;
border-radius:
10px
10px;
background:#666;
}
.sign_QR{
margin-top:
200%;
position:
absolute;
bottom:
50px;
position:
fixed;
background:
#666666;
}
.sign_end{
position:
absolute;
bottom:
0px;
position:
fixed;
background:
#666666;
}
.sign
img{
width:
22px;
height:
22px;
margin-top:
10px;
cursor:
pointer;
}
.run_sign{
width:
100px;
height:
40px;
margin-left:
-100px;
margin-top:
-35px;
background:
#666666;
color:
#1afa29;
font-size:
13px;
line-height:
40px;
cursor:
pointer;
}
.run_QR{
height:
250px;
width:
200px;
margin-left:
-200px;
margin-top:
-245px;
}
.sign_float{
position:
fixed;
}
</style>jQuery代碼這里把圖片的名稱換成數(shù)字的,每一個圖標都有兩個圖片,一個白色和一個綠色的,當鼠標移動到其中一個圖標處時,改變其圖片使其變色,因為一共有八個圖標,所以總共有16張圖片。因此圖片名改變?yōu)楫斍皥D片名稱數(shù)字+8。這里用的動態(tài)是slideDown與slideUp。需要注意的是要設置索引來尋找但前對象的位置(因為是在for循環(huán)里有了索引才能找到當前對象的圖片的數(shù)字名稱)。<script>
$(function(){
$('.run_sign').css('display','none');
$(".run_QR
img").attr("src","img/17.png");
for(var
i=0;i<8;i++){
if(i==6){
$('.sign').eq(i).hover(function(){
$(this).css('background','#ea68a2').find('.img_1').attr("src","img/15.png");
$(this).find('.run_sign').css('visibility','visible').stop().slideDown(200);},function(){
$(this).css('background','#666666').find('.img_1').attr("src","img/7.png");
$(this).find('.run_sign').css('visibility','visible').stop().slideUp(200);})}
else
if(i==5){
$('.sign').eq(i).hover(function(){
$(this).css('background','#ea68a2').find('img').attr("src","img/14.png");},function(){
$(this).css('background','#888888').find('img').attr("src","img/6.png");})}
else{
$('.sign').eq(i).hover(function(){
var
b=$(this).index();
$(this).css('background','#ea68a2').find('img').attr("src","img/"+(b+9)+".png");
$(this).find('.run_sign').css('visibility','visible').stop().slideDown(200);},function(){
var
b=$(this).index();
$(this).css('background','#666666').find('img').attr("src","img/"+(b+1)+".png");
$(this).find('.run_sign').css('visibility','visible').stop().slideUp(200);})}}
});
</script>布局代碼<body>
<div
class="right_ng">
<div
class="sign">
<center>
<img
src="img/1.png"
/>
</center>
<div
class="run_sign">
<center>
<span><b>我的訂單</b></span>
</center>
</div>
</div>
<div
class="sign
sign_top">
<center>
<img
src="img/2.png"
/>
</center>
<div
class="run_sign">
<center>
<span><b>我的收藏</b></span>
</center>
</div>
</div>
<div
class="sign
sign_top">
<center>
<img
src="img/3.png"
/>
</center>
<div
class="run_sign">
<center>
<span><b>我的優(yōu)惠券</b></span>
</center>
</div>
</div>
<div
class="sign
sign_top">
<center>
<img
src="img/4.png"
/>
</center>
<div
class="run_sign">
<center>
<span><b>我的足跡</b></span>
</center>
</div>
</div>
<div
class="sign
sign_top">
<center>
<img
src="img/5.png"
/>
</center>
<div
class="run_sign">
<center>
<span><b>我的JImu</b></span>
</center>
</div>
</div>
<div
class="sign
sign_top
sign_add_height">
<center>
<img
src="img/6.png"
/>
<ul>
<li>購</li>
<li>物</li>
<li>車</li>
<li
class="buy">0</li>
</ul>
</center>
</div>
<div
class="sign
sign_top
sign_QR">
<center>
<img
class="img_1"
src="img/7.png"
/>
</center>
<div
class="run_sign
run_QR">
<center>
<img
class="img_2"
src="img/17.png"
>
<br
/>微信掃碼享優(yōu)惠
</center>
</div>
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- T-ZNZ 264.2-2024 重金屬中度污染農(nóng)田土壤修復和安全利用技術規(guī)范 第2部分:超積累東南景天與中稻輪作
- T-ZZB 3744-2024 制革用陰離子型磺化油
- T-ZMDS 20008-2024 醫(yī)療器械嵌入式軟件漏洞評估方法
- 2025年度解除農(nóng)業(yè)合作項目的聲明書
- 二零二五年度綠化苗木購銷與城市綠化養(yǎng)護服務合同
- 二零二五年度實習教師與教育機構教育咨詢服務合同
- 二零二五年度共享住宅租賃正規(guī)協(xié)議書范本及環(huán)保要求
- 二零二五年度勞動合同主體變更及培訓交接服務合同
- 2025年度水產(chǎn)養(yǎng)殖水質(zhì)改良與養(yǎng)魚合同
- 二零二五年度人社部員工勞動合同勞動合同電子簽名與認證合同
- 4.城軌工程項目勞務分包指導價(車站.盾構.鋪軌)4
- 2024年安全生產(chǎn)網(wǎng)絡知識競賽題庫及答案(共五套)
- 普通工安全技術操作規(guī)程交底注意事項(8篇)
- 2025屆江蘇省十三大市高三沖刺模擬歷史試卷含解析
- DataOps 實踐指南 2.0白皮書
- 供電所班組建設方案
- 委托處置不良資產(chǎn)協(xié)議(三篇)
- 中鐵建新員工培訓
- 2024年02月國家鐵路局事業(yè)單位招考聘用27人筆試歷年(2016-2023年)真題薈萃帶答案解析
- 機加工安全教育培訓
- 星巴克運營管理手冊
評論
0/150
提交評論