HLW/web/common/artDialog3.0.5/artDialog.js

(开头部分) 53KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 * artDialog 3.0.5
 * Date: 2010-12-16
 * http://code.google.com/p/artdialog/
 * (c) 2009-2010 TangBin, http://www.planeArt.cn
 *
 * This is licensed under the GNU LGPL, version 2.1 or later.
 * For details, see: http://creativecommons.org/licenses/LGPL/2.1/
 */

 //-------------“art” 微型DOM引擎模块
(function(){
var $ = function (selector, content) {
		return new $.fn.init(selector, content);
	},
	readyBound = false,
	readyList = [],
	DOMContentLoaded;
 
$.fn = $.prototype = {
	init: function (selector, content) {
		if (!selector) return this;
		this[0] = typeof selector === 'string' ?
			$.selector(selector, content) : selector;
		if (typeof selector === 'function') return $().ready(selector);
		
		return this;
	},
	
	// dom 就绪
	ready: function(fn){
		$.bindReady();

		if ($.isReady) {
			fn.call(document, $);
		} else if (readyList) {
			readyList.push(fn);
		};
		
		return this;
	},
	
	// 判断样式类是否存在
	hasClass: function(name){
		var reg = new RegExp('(\\s|^)' + name + '(\\s|$)');
	
		return this[0].className.match(reg) ? true : false;;
	},
	
	// 添加样式类
	addClass: function (name) {
		if(!this.hasClass(name)) this[0].className += ' ' + name;
		
		return this;
	},
	
	// 移除样式类
	removeClass: function (name) {
		var elem = this[0];
		
后面还有 1934 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。