代码空间项目 -- alert窗口自定义
function z_alert(msg){
//创建提示框盒子,设置盒子的css样式
var msgBox=document.createElement("div");
msgBox.style.width="300px";
msgBox.style.borderRadius="5px";
msgBox.style.position="fixed";
msgBox.style.zIndex=100000;
var maxleft=(window.innerWidth-400)/2;
msgBox.style.top="100px";
msgBox.style.left=maxleft+"px";
//创建遮荫层,背景变暗
var bg=document.createElement("div");
bg.style.height=window.innerHeight+"px";
bg.style.width=window.innerWidth+"px";
bg.style.position="fixed";
msgBox.style.zIndex=99999;
bg.style.top="0px";
bg.style.left="0px";
bg.style.background="black";
bg.style.opacity="0.2";
//创建标题
var msgTitle=document.createElement("div");
msgTitle.style.lineHeight="40px";
msgTitle.style.borderTopLeftRadius="5px";
msgTitle.style.borderTopRightRadius="5px";
msgTitle.style.background="背景图片地址";
msgTitle.style.color="#fff";
msgTitle.style.fontSize="18px";
//移动上去鼠标的样式
msgTitle.style.cursor="move";
msgTitle.style.textAlign="center";
var span=document.createElement("span");
span.innerText="提示";
//创建内容部分的盒子
var content=document.createElement("div");
content.style.height="100px";
content.style.background="#fff";
//传入的提示信息参数
content.innerText=msg;
content.style.overflowY="auto";
content.style.textAlign="center";
content.style.verticalAlign="middle";
content.style.padding="40px";
//创建盒子底部
var bottom=document.createElement("div");
bottom.style.height="30px";
bottom.style.background="#149BDF";
bottom.style.padding="5px";
bottom.style.borderBottomLeftRadius="5px";
bottom.style.borderBottomRightRadius="5px";
//创建关闭按钮
var close=document.createElement("div");
close.innerHTML="确定";
close.style.cursor="pointer";
close.style.width="65px";
close.style.padding="3px 15px";
close.style.background="#fff";
close.style.borderRadius="3px";
close.style.margin="0 auto";
close.style.textAlign="center";
close.onclick=function(){
msgBox.style.visibility="hidden";
bg.style.visibility="hidden";
}
//拼接各级元素
msgBox.appendChild(msgTitle);
msgTitle.appendChild(span);
msgBox.appendChild(content);
msgBox.appendChild(bottom);
bottom.appendChild(close);
document.body.appendChild(msgBox);
document.body.appendChild(bg);
}
代码空间项目 -- alert窗口自定义的更多相关文章
- 代码空间项目 -- InstantiationException的异常
java.lang.InstantiationException实例化异常.当试图通过newInstance()方法创建某个类的实例,而该类是一个抽象类或接口时,抛出该异常. 这次项目中查询type时 ...
- 代码空间项目 -- 获取当前时间之前的某一天-Calender类的使用
Calendar类的静态方法getInstance()可以初始化一个日历对象:Calendar now = Calendar.getInstance(); 1.Calendar的基本用法calenda ...
- 代码空间项目 -- cookie的基本使用
cookie在日常开发b/s架构时候经常使用,可以在记住用户,方便自动登录,也可以记住用户的偏好并对应推送广告 下面说说开发时候的基本用法: 1.创建cookie//设置cookie,键值对形式Coo ...
- c++实现输入法窗口自定义的代码
#pragma once #include <Windows.h> #include <imm.h> #include <string> #pragma comme ...
- VS Code项目中共享自定义的代码片段方案
VS Code项目中共享自定义的代码片段方案 一.问题背景 项目中注释风格不统一,如何统一注释风格 一些第三方组件库名称太长,每次使用都需要找文档,然后复制粘贴 部分组件库有自己的Snippets插件 ...
- 雷林鹏分享:jQuery EasyUI 窗口 - 自定义窗口工具栏
jQuery EasyUI 窗口 - 自定义窗口工具栏 默认情况下,窗口(window)有四个工具:collapsible.minimizable.maximizable 和 closable.比如我 ...
- 超详细的Xcode代码格式化教程,可自定义样式。
超详细的Xcode代码格式化教程,可自定义样式. 为什么要格式化代码 当团队内有多人开发的时候,每个人写的代码格式都有自己的喜好,也可能会忙着写代码而忽略了格式的问题.在之前,我们可能会写完代码后,再 ...
- jeecg项目子窗口获得父窗口元素id
jeecg项目子窗口获得父窗口元素id, var parentWin = frameElement.api.opener;alert($(parentWin.document).find(" ...
- 雷林鹏分享:jQuery EasyUI 窗口 - 自定义带有工具条和按钮的对话框
jQuery EasyUI 窗口 - 自定义带有工具条和按钮的对话框 您可以创建一个带有工具栏(toolbar)和按钮(button)的对话框(dialog),可以从 HTML 标记创建.这个教程描述 ...
随机推荐
- 表格 td中,取checkbox后几位值
function addToPanDianDetail() { var detail_id = ""; var detail_code = ""; $(&quo ...
- 快速掌握分布式搜索引擎ElasticSearch(一)
前言 由于最近在项目中接触使用到了ElasticSearch,从本篇博客开始将给大家分享这款风靡全球的产品.将涉及到ElasticSearch的安装.基础概念.基本用法.高级查询.中文分词器.与Spr ...
- MySql----on duplicate key
mysql on duplicate key 语句是解决key 冲突的问题,同时 ,key 包括 primary key 和 unique key 等
- 迅雷在P2P网络中的另类上传速度
如上图,我们一般在下载BT时,一般P2P是边下载边上传. 但是迅雷在自己的软件中可以设置上传速度,反而在展示时却把P2P协议的速度不在上传那么显示,而是使用协议速度来进行展示:并且这个速度无法设置. ...
- sql server 博客
http://blog.csdn.net/tjvictor/article/category/531421/1 http://blog.csdn.net/zhangqidashu/article/de ...
- soursTree新建过程.md
网上博客 https://www.cnblogs.com/tian-xie/p/6264104.html 主要的推送流程 完成所有项目的远程推送工作 点击git工作流选择第二个建立新的版本; 输入发布 ...
- 【UI】为项目添加类似于淘宝筛选列表勾选的ui-choose
jQuery下载的地址:http://www.htmleaf.com/jQuery/Form/201512182916.html GitHub地址:https://github.com/wangxin ...
- Golang协程与通道整理
协程goroutine 不由OS调度,而是用户层自行释放CPU,从而在执行体之间切换.Go在底层进行协助实现 涉及系统调用的地方由Go标准库协助释放CPU 总之,不通 ...
- libsvm交叉验证与网格搜索(参数选择)
首先说交叉验证.交叉验证(Cross validation)是一种评估统计分析.机器学习算法对独立于训练数据的数据集的泛化能力(generalize), 能够避免过拟合问题.交叉验证一般要尽量满足:1 ...
- 无向图的点双连通分量(tarjan模板)
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #i ...