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

Plugin Description: jQuery Tmall-style fixed floating sidebar navigation with a 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(){ }); } }); }}); |
评论