File: /www/wwwroot/bs.kntsleep.com/install/js/install.js
$(document).ready(function(e){
var at = window.location.hash.match(/#_alert=(.+?),(red|green|blue|yellow|gold)/);
if(at){
_alert(decodeURI(at[1]),at[2]);
window.location.hash = window.location.hash.replace(at[0],'');
}
function _alert(str, type){
var date = new Date();
now = date.getTime();
$('body').append('<h6 class="alert '+type+'" time="'+now+'" style="z-index:'+now+';"><b>'+str+'</b></h6>');
tha = $('h6.alert[time="'+now+'"]');
tha.animate({top:78,opacity:1},288);
(function(tha){
window.setTimeout(function(){
tha.remove();
},
tha.hasClass('green')?3000:2000);
})(tha);
}
if($('section.license div.content').length>0){
lcheight = $('section.license div.content>div').height();
$('section.license div.content').scroll(function(){
if($(this).scrollTop()+580 >= lcheight){
$('section.license div.next a').removeClass('nosee');
}
});
$('section.license div.next>a[url]').click(function(){
if($(this).hasClass('nosee')){
alert('请先阅读完用户协议再点击!');
}else{
$(this).attr('href', $(this).attr('url'));
}
});
}
if($('section.check').length>0){
$('section.check .table h2').click(function(){
$(this).parents('.table').toggleClass('on');
});
}
$('code.checkbox label.checkbox').change(function(){
if($(this).find('input').is(':checked')){
$(this).addClass('checked');
}else{
$(this).removeClass('checked');
}
});
$('form.form').submit(function(){
if($(this).hasClass('down')){
return false;
}else{
$(this).addClass('down');
$(this).find('button').prepend('<em class="fa fa-spinner"></em>');
}
});
});