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
//当事件触发时,获取鼠标相对于元素的坐标 | |
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
/** | |
* 移除确认对话框 | |
* @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
.test{ | |
/*设置半透明边框*/ | |
border: 10px solid hsla(0,0%,100%,.5); | |
background: white; | |
/*背景从内边距开始裁切,从而不遮挡半透明边框*/ | |
background-clip: padding-box; | |
} |
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
@keyframes spin { | |
from { | |
transform: rotate(0turn) | |
translateY(-150px) translateY(50%) | |
rotate(1turn); | |
} | |
to { | |
transform: rotate(1turn) | |
translateY(-150px) translateY(50%) | |
rotate(0turn); |
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
@keyframes panoramic { | |
to { background-position: 100% 0; } | |
} | |
.panoramic { | |
width: 150px; height: 150px; | |
background: url("img/naxos-greece.jpg"); | |
background-size: auto 100%; | |
animation: panoramic 10s linear infinite alternate; | |
animation-play-state: paused; | |
} |
OlderNewer