mirror of https://github.com/helloxz/onenav.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
942 B
41 lines
942 B
function gotop(){ |
|
$("html,body").animate({scrollTop: '0px'}, 600); |
|
} |
|
$(".search").blur(function(data,status){ |
|
var keywords = $(".search").val(); |
|
|
|
if( keywords == ''){ |
|
$(".cat-title").removeClass("mdui-hidden"); |
|
} |
|
|
|
}); |
|
var h = holmes({ |
|
input: '.search', |
|
find: '.link-space', |
|
placeholder: '<h3>未搜索到匹配结果!</h3>', |
|
mark: false, |
|
hiddenAttr: true, |
|
// 找到了就添加visible类,没找到添加mdui-hidden |
|
class: { |
|
visible: 'visible', |
|
hidden: 'mdui-hidden' |
|
}, |
|
onHidden(el) { |
|
// console.log('hidden', el); |
|
|
|
}, |
|
onFound(el) { |
|
// console.log('found', el); |
|
$(".cat-title").addClass("mdui-hidden"); |
|
}, |
|
onInput(el) { |
|
$(".cat-title").addClass("mdui-hidden"); |
|
}, |
|
onVisible(el) { |
|
$(".cat-title").removeClass("mdui-hidden"); |
|
}, |
|
onEmpty(el) { |
|
$(".cat-title").removeClass("mdui-hidden"); |
|
} |
|
}); |
|
//鼠标移动到链接修改为原始URL
|
|
|