HTML实现遮罩层的方法 HTML中如何使用遮罩层
$('.overlay').css({'height':$(document).height(),'width':$(document).width()}); $('.overlay').show(); }
/** * 显示Loading提示 */ function showLoading() { // 先显示遮罩层 showOverlay(); // Loading提示窗口居中 $("#loadingTip").css('top', (getWindowInnerHeight() - $("#loadingTip").height()) / 2 + 'px'); $("#loadingTip").css('left', (getWindowInnerWidth() - $("#loadingTip").width()) / 2 + 'px');
$("#loadingTip").show(); $(document).scroll(function() { return false; }); }
/** * 隐藏Loading提示 */ function hideLoading() { $('.overlay').hide(); $("#loadingTip").hide(); $(document).scroll(function() { return true; }); }
/** * 模拟弹出模态窗口DIV * @param innerHtml 模态窗口HTML内容 */ function showModal(innerHtml) { // 取得显示模拟模态窗口用DIV var dialog = $('#modalDiv');
// 设置内容 dialog.html(innerHtml);
// 模态窗口DIV窗口居中 dialog.css({ (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |