.window Class
- -全局函数
--
-
- Index -
- Methods -
- Properties -
Item Index
-Methods
--
-
- - addUrlParams - static - -
- - cloneDate - static - -
- - dateDetect - static - -
- - delUrlParam - static - -
- - easyEffect - static - -
- - formatISODate - static - -
- - funcName - static - -
- - getJqParent - static - -
- - getUrlParam - static - -
- - getUrlParams - static - -
- - hasUrlParam - static - -
- - httpRequire - static - -
- - isSameDay - static - -
- - isSameMonth - static - -
- - jcAutoInitComps - static - -
- - maxDayOfMonth - static - -
- - mousewheelEvent - static - -
- - padChar - static - -
- - parentSelector - static - -
- - parseBool - static - -
- - parseFinance - static - -
- - parseISODate - static - -
- - printf - static - -
- - pureDate - -
- - reloadPage - static - -
- - removeUrlSharp - static - -
- - scriptContent - static - -
- - scriptPath - static - -
- - sliceArgs - static - -
- - urlDetect - static - -
Properties
--
-
- - $.support.isFixed - static - -
- - ZINDEX_COUNT - static - -
Methods
-addUrlParams
- -
-
-
-
_url-
- -
-
_params-
-
添加URL参数
-
require: delUrlParam
Returns:
-string
-Example:
- var url = addUrlParams( location.href, {'key1': 'key1value', 'key2': 'key2value' } );
- cloneDate
- -
-
-
-
_date-
-
克隆日期对象
-Parameters:
--
-
-
-
_date- Date ---需要克隆的日期
-
-
Returns:
-需要克隆的日期对象
-dateDetect
- -
-
-
-
_dateStr-
-
日期占位符识别功能
-Parameters:
--
-
-
-
_dateStr- String ---如果 起始字符为 NOW, 那么将视为当前日期
-
-
Returns:
-Example:
- dateDetect( 'now' ); //2014-10-02
- dateDetect( 'now,3d' ); //2013-10-05
- dateDetect( 'now,-3d' ); //2013-09-29
- dateDetect( 'now,2w' ); //2013-10-16
- dateDetect( 'now,-2m' ); //2013-08-02
- dateDetect( 'now,4y' ); //2017-10-02
- dateDetect( 'now,1d,1w,1m,1y' ); //2014-11-10
- delUrlParam
- -
-
-
-
_url-
- -
-
_key-
-
删除URL参数
-Returns:
-string
-Example:
- var url = delUrlParam( location.href, 'tag' );
- easyEffect
- -
-
-
-
_cb-
- -
-
_maxVal-
- -
-
_startVal-
- -
-
_duration-
- -
-
_stepMs-
-
缓动函数, 动画效果为按时间缓动
-
这个函数只考虑递增, 你如果需要递减的话, 在回调里用 _maxVal - _stepval
Parameters:
- -Returns:
-interval
-Example:
- $(document).ready(function(){
- window.js_output = $('span.js_output');
- window.ls = [];
- window.EFF_INTERVAL = easyEffect( effectcallback, 100);
- });
- function effectcallback( _stepval, _done ){
- js_output.html( _stepval );
- ls.push( _stepval );
- !_done && js_output.html( _stepval );
- _done && js_output.html( _stepval + '<br />' + ls.join() );
- }
- formatISODate
- -
-
-
-
_date-
- -
-
_split-
-
格式化日期为 YYYY-mm-dd 格式
-
require: pad_char_f
Parameters:
- -Returns:
-string
-funcName
- -
-
-
-
_func-
-
取函数名 ( 匿名函数返回空 )
-Parameters:
--
-
-
-
_func- Function ---
-
Returns:
-string
-getJqParent
- -
-
-
-
_selector-
- -
-
_filter-
-
获取 selector 的指定父级标签
-Parameters:
--
-
-
-
_selector- Selector ---
- -
-
_filter- Selector ---
-
Returns:
-selector
-getUrlParam
- -
-
-
-
_url-
- -
-
_key-
-
取URL参数的值
-Returns:
-string
-Example:
- var defaultTag = getUrlParam(location.href, 'tag');
- getUrlParams
- -
-
-
-
_url-
- -
-
_key-
-
取URL参数的值, 这个方法返回数组
-
与 getUrlParam 的区别是可以获取 checkbox 的所有值
Returns:
-Array
-Example:
- var params = getUrlParams(location.href, 'tag');
- hasUrlParam
- -
-
-
-
_url-
- -
-
_key-
-
判断URL中是否有某个get参数
-Returns:
-bool
-Example:
- var bool = hasUrlParam( 'getkey' );
- httpRequire
- -
-
-
-
_msg-
-
提示需要 HTTP 环境
-Parameters:
--
-
-
-
_msg- String ---要提示的文字, 默认 "本示例需要HTTP环境'
-
-
Returns:
-bool 如果是HTTP环境返回true, 否则返回false
-isSameDay
- -
-
-
-
_d1-
- -
-
_d2-
-
判断两个日期是否为同一天
-Returns:
-isSameMonth
- -
-
-
-
_d1-
- -
-
_d2-
-
判断两个日期是否为同一月份
-Returns:
-jcAutoInitComps
- -
-
-
-
_selector-
-
动态添加内容时, 初始化可识别的组件
--
-
- 目前会自动识别的组件, -
-
- Bizs.CommonModify, JC.Panel, JC.Dialog
-
自动识别的组件不用显式调用 jcAutoInitComps 去识别可识别的组件 -
-
- - 可识别的组件 -
-
- JC.AutoSelect, JC.Calendar, JC.AutoChecked, JC.AjaxUpload, JC.Placeholder
-
Bizs.DisableLogic, Bizs.FormLogic -
-
-
-
-
Parameters:
--
-
-
-
_selector- Selector ---
-
maxDayOfMonth
- -
-
-
-
_date-
-
取得一个月份中最大的一天
-Parameters:
--
-
-
-
_date- Date ---
-
Returns:
-月份中最大的一天
-mousewheelEvent
- -
-
-
-
_cb-
- -
-
_detach-
-
绑定或清除 mousewheel 事件
-Parameters:
--
-
-
-
_cb- Function ---
- -
-
_detach- Bool ---
-
padChar
- -
-
-
-
_str-
- -
-
_len-
- -
-
_char-
-
js 附加字串函数
-Returns:
-string
-parentSelector
- -
-
-
-
_item-
- -
-
_selector-
- -
-
_finder-
-
扩展 jquery 选择器
-
扩展起始字符的 '/' 符号为 jquery 父节点选择器
-
扩展起始字符的 '|' 符号为 jquery 子节点选择器
-
扩展起始字符的 '(' 符号为 jquery 父节点查找识别符( getJqParent )
Parameters:
--
-
-
-
_item- Selector ---
- -
-
_selector- String ---
- -
-
_finder- Selector ---
-
Returns:
-selector
-parseBool
- -
-
-
-
_input-
-
把输入值转换为布尔值
-Parameters:
--
-
-
-
_input- ---
-
Returns:
-bool
-parseFinance
- -
-
-
-
_i-
- -
-
_dot,-
-
取小数点的N位
-
JS 解析 浮点数的时候,经常出现各种不可预知情况,这个函数就是为了解决这个问题
Parameters:
--
-
-
-
_i- Number ---
- -
-
_dot,- Int ---default = 2
-
-
Returns:
-number
-parseISODate
- -
-
-
-
_datestr-
-
从 ISODate 字符串解析日期对象
-Parameters:
--
-
-
-
_datestr- String ---
-
Returns:
-date
-printf
- -
-
-
-
_str-
-
按格式输出字符串
-Parameters:
--
-
-
-
_str- String ---
-
Returns:
-string
-Example:
- printf( 'asdfasdf{0}sdfasdf{1}', '000', 1111 );
- //return asdfasdf000sdfasdf1111
- pureDate
- -
-
-
-
_d-
-
获取不带 时分秒的 日期对象
-Parameters:
--
-
-
-
_d- Date ---可选参数, 如果为空 = new Date
-
-
Returns:
-Date
-reloadPage
- -
-
-
-
$url-
- -
-
$nornd-
- -
-
$delayms-
-
重载页面
-
require: removeUrlSharp
-
require: addUrlParams
Parameters:
--
-
-
-
$url- String ---
- -
-
$nornd- Bool ---
- -
-
$delayms- Int ---
-
removeUrlSharp
- -
-
-
-
$url-
- -
-
$nornd-
-
删除 URL 的锚点
-
require: addUrlParams
Parameters:
--
-
-
-
$url- String ---
- -
-
$nornd- Bool ---是否不添加随机参数
-
-
Returns:
-string
-scriptContent
- -
-
-
-
_selector-
-
获取脚本模板的内容
-Parameters:
--
-
-
-
_selector- Selector ---
-
Returns:
-string
-scriptPath
- ()
-
- String
-
- static
-
- 取当前脚本标签的 src路径
-Returns:
-脚本所在目录的完整路径
-sliceArgs
- -
-
-
-
args-
-
把函数的参数转为数组
-Parameters:
--
-
-
-
args- Arguments ---
-
Returns:
-Array
-urlDetect
- -
-
-
-
_url-
-
URL 占位符识别功能
-Parameters:
--
-
-
-
_url- String ---如果 起始字符为 URL, 那么 URL 将祝为本页的URL
-
-
Returns:
-string
-Example:
- urlDetect( '?test' ); //output: ?test
- urlDetect( 'URL,a=1&b=2' ); //output: your.com?a=1&b=2
- urlDetect( 'URL,a=1,b=2' ); //output: your.com?a=1&b=2
- urlDetect( 'URLa=1&b=2' ); //output: your.com?a=1&b=2
- Properties
-$.support.isFixed
- Bool
- static
-
- 判断是否支持 CSS position: fixed
-ZINDEX_COUNT
- Int
- static
-
- 全局 css z-index 控制属性
-Default: 50001
-