jQuery Tmall-Style Fixed Floating Sidebar Navigation (With Close Button)

Add-ons
2026-07-26 05:49 4 次浏览 • 0 次下载 40.0KB
jQuery Tmall-Style Fixed Floating Sidebar Navigation (With Close Button)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var browser={
versions:function(){
var u = navigator.userAgent, app = navigator.appVersion;
return { // Mobile browser version information
trident: u.indexOf('Trident') > -1, // IE engine
presto: u.indexOf('Presto') > -1, // Opera engine
webKit: u.indexOf('AppleWebKit') > -1, // Apple and Google engines
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, // Firefox engine
mobile: !!u.match(/AppleWebKit.*Mobile.*/), // Whether this is a mobile device
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), // iOS device
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, // Android device or UC Browser
iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, // Whether this is an iPhone or QQ HD browser
iPad: u.indexOf('iPad') > -1, // Whether this is an iPad
webApp: u.indexOf('Safari') == -1 // Whether this is a web application without a header or footer
};
}(),
language:(navigator.browserLanguage || navigator.language).toLowerCase()
}
$(document).ready(function(){
if(!browser.versions.mobile){
var _st = $.cookie("fixed");
if(!_st)_st=0;
var _code = '<div id="fixed"><dl><dd><a href="http://www.jq22.com/" class="web">Web Games</a></dd><dd><a href="http:/www.jq22.com/" class="mb">Mobile Games</a></dd><dd><a href="http://www.jq22.com/" target="_blank" class="dj">Anime</a></dd><dd><a href="http://www.jq22.com/" target="_blank" class="mh">Manga</a></dd><dd><a href="http://www.jq22.com/" target="_blank" class="dh">Animation</a></dd><dd><a href="http://www.jq22.com/" class="pk165">Novels</a></dd><dd><a href="http://www.jq22.com/" class="w267">Community</a></dd><dt><a href="javascript:void(0);" class="close"></a></dt></dl></div>';
if(_st==1){
$(_code).hide().appendTo("body").fixed({x:-44,y:0}).fadeIn(500);
$("#fixed dt a.close").width('68px');
} else {
$(_code).hide().appendTo("body").fixed({x:0,y:0}).fadeIn(500);
}
$("#fixed dt").click(function(){
var _left = $("#fixed").offset().left;
if(_left>=0){
$.cookie("fixed",1,{path:'/'});
$("#fixed").animate({left:-44},300,'swing',function(){
$("#fixed dt a.close").hide().width('68px').fadeIn(500);
});
} else {
$.cookie("fixed",0,{path:'/'});
$("#fixed dt a.close").width('44px');
$("#fixed").animate({left:0},300,'swing',function(){
});
}
});
}
});
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare