This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 移除确认对话框 | |
* @param {object/string} arg 用于设置的参数或url字符串 | |
* @param {function} callback 回调函数 | |
*/ | |
function removeConfirm(arg,callback){ | |
var option = { | |
//datagrid的Id | |
datagridId: arg.datagridId ? arg.datagridId : "datagrid", | |
//url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 动态生成combobox,获取后端传来的json数据 | |
* @param {string} comboboxId combobox的ID | |
* @param {string} url url | |
* @param {string} value combobox的value对应的属性名 | |
* @param {string} text combobobx的显示文本对应的属性名 | |
*/ | |
function dynamicCombobox(comboboxId,url,value,text){ | |
$("#"+comboboxId).combobox({ | |
valueField:value, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* easyui-addDialog | |
* @param {string/object} arg 可以是url,也可以是参数设置对象 | |
* @param {string} dialogId 会话框Id | |
* @param {function} callback 回调函数 | |
*/ | |
function addDialog(arg,dialogId,callback){ | |
/*默认参数设置*/ | |
var option = { | |
//宽度 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 更新会话框 | |
* @param {object/string} arg 设置对象或者url | |
* @param {function} callback 回调函数 | |
*/ | |
function updateDialog(arg,callback){ | |
var option = { | |
//datagrid的Id | |
datagridId: arg.datagridId ? arg.datagridId : "datagrid", | |
//标志后端采取更新操作或者是添加操作的隐藏表单的id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* columns示例:[[{field:'parentId',title:'字段A',width:400,halign:"center",align:"center", formatter:function(value, row, index){return getParent(row.parentId);}}]] | |
* 动态生成数据表格 | |
* @param {object/string} arg url字符串或者设置对象 | |
* @param {string} datagridId datagrid的Id | |
* @param {array} columns 数据列定义,二维数组 | |
*/ | |
function dynamicPageGrid(arg,datagridId,columns){ | |
var option = { | |
//每页大小 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//当事件触发时,获取鼠标相对于元素的坐标 | |
function captureMouse(elem) { | |
var obj = {x:0,y:0}; | |
elem.addEvent("click", function(e) { | |
var x, y; | |
var event = e || window.event, | |
element = event.currentTarget; | |
//获取鼠标位于当前屏幕的位置, 并作兼容处理 | |
if (event.pageX || event.pageY) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var lastTime = 0; | |
var vendors = ['webkit', 'moz','ms','o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | |
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; | |
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || // name has changed in Webkit | |
window[vendors[x] + 'CancelRequestAnimationFrame']; | |
} | |
if (!window.requestAnimationFrame) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>CSS is awesome!</h1> | |
<style> | |
@keyframes typing { | |
from { width: 0 } | |
} | |
@keyframes caret { | |
50% { border-color: currentColor; } | |
} | |
h1 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*效果:输入框提示元素的放大动画,过程:元素出现->元素超出大小->回到原始大小*/ | |
input:not(:focus) + .callout{ | |
/*覆盖了动画函数,动画函数使用默认值ease,同时使用修正了不同函数的动画时间*/ | |
transform:scale(0); | |
/*防止动画效果用在了,诸如背景等属性上产生异样的效果*/ | |
transition:.25s transform; | |
} | |
.callout{ | |
transform-origin:1.4em -.4em; | |
transition:.5s cubic-bezier(.25,.1,.3,1.5) transform; |
OlderNewer