/* 禁止右键选择 */
|
document.oncontextmenu = function () { return true; }
|
document.onselectstart = function () { return true; }
|
|
/* 链接标题 */
|
$('a').each(function (index) { $('a').eq(index).attr('title', $(this).text()); });
|
|
/* 文本框自动内容 */
|
$('input[type="text"]').attr('placeholder', '请输入');
|
|
/* 导航菜单 */
|
$('.nav-content').first().show();
|
$('.nav-title').each(function (index) {
|
$('.nav-title').eq(index).click(function () {
|
$(this).addClass('current').siblings('.nav-title').removeClass('current');
|
|
if (index >= 1) {
|
$('.nav-content').eq(index - 1).slideDown('fast').siblings('.nav-content').hide();
|
$('.nav-content').eq(index - 1).siblings('.nav-content').children('li').removeClass('current');
|
} else {
|
$('.nav-content').slideUp('fast');
|
// parent.document.getElementById('mainFrame').src = 'Default.aspx'; //跳转到首页
|
}
|
|
$(this).find('.fa-angle-up').attr('class', 'fa fa-angle-down second-item');
|
$(this).siblings('.nav-title').find('.fa-angle-down').attr('class', 'fa fa-angle-up second-item');
|
});
|
});
|
|
$('.nav-content li').each(function (index) {
|
$(this).click(function () {
|
$(this).addClass('current').siblings('.nav-content li').removeClass('current');
|
});
|
})
|
|
/* 下拉菜单 */
|
$('#user-login').mouseover(function() {
|
$(this).find('.fa-angle-up').attr('class', 'fa fa-angle-down second-item');
|
}).mouseout(function() {
|
$(this).find('.fa-angle-down').attr('class', 'fa fa-angle-up second-item');
|
});
|
|
/* 框架内页链接 */
|
function togglePage(page) { parent.document.getElementById('mainFrame').src = page ; }
|
|
/* 自动宽度 */
|
function autoSize() {
|
//$('.table-container').css('width', screen.width-270 + 'px');
|
$('#corel').css('width', document.body.clientWidth - 20 + 'px');
|
$('.columns-half').each(function (index) {
|
$('.columns-half').eq(index).css('width', (document.getElementById('corel').offsetWidth-20)/2 + 'px');
|
});
|
}
|
|
autoSize();
|
|
$(window).resize(function() {
|
autoSize();
|
});
|
|
/* 文件框 */
|
$('#file-upload').click(function () {
|
$('#MyFile').click();
|
});
|
|
/* FlatUI表单实例化 */
|
$(':radio').radiocheck();
|
$(':checkbox').radiocheck();
|
$("select").select2({dropdownCssClass: 'dropdown-inverse'});
|
|
//alert($('.table-container ').css('width'));
|
|
/* 表格样式 */
|
function tableStyle(tableId) {
|
//表格初始化
|
function initTable(tableId) {
|
$(tableId + ' tr').each(function(index) {
|
$(tableId + ' .select-item').eq(index + 1).attr('checked', false);
|
|
if(index >= 1 && index % 2 != 0) {
|
$(tableId + ' tr').eq(index).attr('class', 'odd');
|
} else if(index >= 1 && index % 2 != 1) {
|
$(tableId + ' tr').eq(index).attr('class', 'even');
|
}
|
});
|
}
|
|
initTable(tableId);
|
|
|
//单项选择
|
function singleSelect(ele) {
|
$(tableId + ' ' + ele).each(function (index) {
|
$(tableId + ' ' + ele).eq(index + 1).click(function () {
|
$(tableId + ' tr').eq(index + 1).toggleClass('current');
|
});
|
});
|
}
|
|
singleSelect('.select-item');
|
singleSelect('.select-item2');
|
singleSelect('.select-item3');
|
singleSelect('.select-item4');
|
singleSelect('.select-item5');
|
|
//全选
|
function allSelect(elea, eleb, elec) {
|
$(tableId + ' ' + elea).click(function () {
|
if ($(tableId + ' ' + eleb).prop('checked') == true) {
|
$(tableId + ' ' + elec).each(function (index) {
|
if (index == $(tableId + ' ' + elec).size() - 1) {
|
return;
|
}
|
|
$(tableId + ' tr').eq(index + 1).attr('class', 'current');
|
$(tableId + ' ' + elec).eq(index + 1).attr('checked', true);
|
});
|
} else {
|
initTable(tableId);
|
}
|
});
|
}
|
|
allSelect('.select-all', '.select-all:eq(0)', '.select-item');
|
allSelect('.select-all2', '.select-all2:eq(0)', '.select-item2');
|
allSelect('.select-all3', '.select-all3:eq(0)', '.select-item3');
|
allSelect('.select-all4', '.select-all4:eq(0)', '.select-item4');
|
allSelect('.select-all5', '.select-all5:eq(0)', '.select-item5');
|
}
|
|
$('table:not(.queryTable)').each(function(index) {
|
tableStyle('#' + $(this).attr('id'));
|
});
|
|
/* 表格兼容浮动 */
|
$('.table-container').each(function(index) {
|
if($(this).prop('scrollWidth') <= (screen.width-260)) {
|
$(this).css('overflow-x', 'auto');
|
} else {
|
$(this).css('overflow-x', 'scroll');
|
}
|
});
|
|
/* 数据删除提示 */
|
function delItem() {
|
swal({
|
title: '您确定要删除吗?',
|
text: '删除后,将永远也看不到它了。',
|
type: 'warning',
|
showCancelButton: true,
|
confirmButtonColor: '#dd6b55',
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
closeOnConfirm: false
|
}, function() {
|
swal('成功信息', '已删除,您再也看不到它了。', 'success');
|
});
|
}
|
|
/* 查询区域隐藏 */
|
var toggleQuery = 0;
|
$('#channel-title').click(function() {
|
if (toggleQuery == 0) {
|
$('#channel-title').css('background', '#3498db');
|
$('#channel-title i').first().attr('class', 'fa fa-angle-double-down');
|
$('#query-area').slideDown('fast');
|
toggleQuery = 1;
|
} else {
|
$('#channel-title').css('background', '#5dade2');
|
$('#channel-title i').first().attr('class', 'fa fa-angle-double-up');
|
$('#query-area').slideUp('fast');
|
toggleQuery = 0;
|
}
|
});
|
|
var toggleQueryAdd = 0;
|
$('#channel-titleAdd').click(function () {
|
if (toggleQueryAdd == 0) {
|
$('#channel-titleAdd').css('background', '#3498db');
|
$('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-down');
|
$('#query-areaAdd').slideDown('fast');
|
toggleQueryAdd = 1;
|
} else {
|
$('#channel-titleAdd').css('background', '#5dade2');
|
$('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-up');
|
$('#query-areaAdd').slideUp('fast');
|
toggleQueryAdd = 0;
|
}
|
});
|
|
|
toggleQueryAddNew=0
|
$('#Button_AddNewCard').click(function () {
|
if (toggleQueryAddNew == 0) {
|
$('#channel-titleAdd').css('background', '#3498db');
|
$('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-down');
|
$('#query-areaAdd').slideDown('fast');
|
toggleQueryAddNew = 1;
|
} else {
|
$('#channel-titleAdd').css('background', '#5dade2');
|
$('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-up');
|
$('#query-areaAdd').slideUp('fast');
|
toggleQueryAddNew = 0;
|
}
|
});
|
|
|
toggleUpdateAddNew = 0
|
$('#Button_Update').click(function () {
|
if (toggleUpdateAddNew == 0) {
|
$('#channel-titleAdd').css('background', '#3498db');
|
$('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-down');
|
$('#query-areaAdd').slideDown('fast');
|
toggleUpdateAddNew = 1;
|
} else {
|
$('#channel-titleAdd').css('background', '#5dade2');
|
$('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-up');
|
$('#query-areaAdd').slideUp('fast');
|
toggleUpdateAddNew = 0;
|
}
|
});
|
|
/* 分页样式 */
|
$('a[title="上一页"]').attr('class', 'paginator page-btn');
|
$('a[title="下一页"]').attr('class', 'paginator page-btn');
|
$('a[title="首页"]').attr('class', 'paginator page-btn page-btn-home');
|
$('a[title="尾页"]').attr('class', 'paginator page-btn page-btn-last');
|
|
$('.paginator input[type="submit"]').val('跳转');
|
|
var x = true;
|
var i = 0;
|
$('#body_default').onmousemove(function () {
|
alert("11");
|
i = i + 1;
|
x = true;
|
});
|
function test() {
|
alert("22");
|
setTimeout("test()", 2000);
|
if (x == false) {
|
//window.close();
|
alert("11");
|
}
|
x = false;
|
}
|