//分类添加到菜单栏
$("a[href*='/cat/']").not(".pagination>span,.pagination>a").each(function(){
$(this).attr("target","_blank");
$(this).appendTo(".fenlei");
});
$(".fenlei>a").wrap("<li></li>");
//自动识别空文件类型
$('.file_list li').each(function(){
if($(this).children('span').length == 0){
$(this).find($("a[href*='wodemo.net/site/']")).after('<span>(write)</span>');
//下面的“bogey.wodemo.net”改为自己的地址
$(this).find($("a[href*='bogey.wodemo.net']")).after('<span>(write)</span>');
}
//添加文件图标
$(this).find($("a[href*='net/site/']")).before('<div style="width:50px; height:50px; background:url(https://nop.wodemo.com/entry/426989/20170119/85ea95b2b18cc2530a894b8144cf3e39/icon.png); display:inline-block; float:left;"/>');
//下面的“bogey.wodemo.net”改为自己的地址,图片地址自己看着办
$(this).find($("a[href*='bogey.wodemo.net']")).before('<div style="width:50px; height:50px; background:url(https://nop.wodemo.com/entry/426989/20170119/85ea95b2b18cc2530a894b8144cf3e39/icon.png); display:inline-block; float:left;"/>');
});
//修改图标显示位置
var arr = new Array();
//文档类
arr['doc'] = "0px 0px";
arr['docx'] = "-50px 0px";
arr['ppt'] = "-100px 0px";
arr['pptx'] = "-150px 0px";
arr['xls'] = "-200px 0px";
arr['xlsx'] = "-250px 0px";
//视频类
arr['avi'] = "0px -50px";
arr['mp4'] = "-50px -50px";
arr['wmv'] = "-100px -50px";
arr['flv'] = "-150px -50px";
arr['fla'] = "-200px -50px";
arr['swf'] = "-250px -50px";
//APK
arr['apk'] = "0px -100px";
//系统类
arr['exe'] = "-50px -100px";
arr['bat'] = "-100px -100px";
arr['write'] = "-150px -100px";
arr['zip'] = "-200px -100px";
arr['rar'] = "-250px -100px";
//音乐类
arr['mp3'] = "0px -150px";
arr['wma'] = "-50px -150px";
arr['flac'] = "-100px -150px";
arr['ape'] = "-150px -150px";
arr['mid'] = "-200px -150px";
arr['wav'] = "-250px -150px";
//文档类
arr['txt'] = "0px -200px";
arr['css'] = "-50px -200px";
arr['chm'] = "-100px -200px";
arr['pdf'] = "-150px -200px";
arr['html'] = "-200px -200px";
arr['other'] = "-250px -200px";
//图片类
arr['jpg'] = "0px -250px";
arr['jpeg'] = "-50px -250px";
arr['gif'] = "-100px -250px";
arr['png'] = "-150px -250px";
arr['bmp'] = "-200px -250px";
arr['psd'] = "-250px -250px";
$('.file_list li span').each(function(){
//转换后缀首字母为大写
var text=$(this).text().replace("\(","").replace("\)","");
text=text.substr(0,1).toUpperCase()+text.substr(1).toLowerCase();
$(this).text(text);
for(var key in arr){
if($(this).text().toLowerCase() == key){
$(this).parent('li').children('div').css('background-position',arr[key]);
break;
}
else{
$(this).parent('li').children('div').css('background-position',arr['other']);
}
}
});
//去掉多余链接部分(如In-h)
var nohome=document.getElementById("whole_body");
nohome.innerHTML=nohome.innerHTML.replace(/\<span\sid\=\"ln\-h\"\>.+\n.+/,"");
//新菜单栏
$('.menu,.munu_zg').click(function(){
if($('.munu_right').width() == 0){
$('html').height($(window).height()).css('overflow','hidden');
$('.munu_zg').show();
$('.munu_right').animate({
'width' : '400px'
});
}else{
$('html').height('100%').css('overflow','visible');
$('.munu_zg').hide();
$('.munu_right').animate({
'width' : '0'
});
}
});
$('.ul_box_title').click(function(){
if($(this).next('.ul_sub').css('display') != "block"){
// $('.ul_sub').slideUp();
$(this).next('.ul_sub').slideDown();
}
else{
$(this).next('.ul_sub').slideUp();
}
});
//返回顶部
$(".back_top").hide();
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('.back_top').fadeIn();
} else {
$('.back_top').fadeOut();
}
});
$('.back_top').click(function () {
$('body,html').animate({
scrollTop: 0
}, 800); return false;
});
});
Back to home |
File page
Subscribe |
Register |
Login
| N