WebRoot/static/os/js/zySearch.js

(开头部分) 4KB

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

/*
 * zySearch.js 
*/

(function($, undefined) {
	$.fn.zySearch = function(options, param) {
		var otherArgs = Array.prototype.slice.call(arguments, 1);
		if (typeof options == 'string') {
			var fn = this[0][options];
			if ($.isFunction(fn)) {
				return fn.apply(this, otherArgs);
			} else {
				throw ("zySearch - No such method: " + options);
			}
		}

		return this.each(function() {
			var para = {}; // 保留参数
			var self = this; // 保存组件对象

			var defaults = {
				"width" : "355",
				"height" : "35",
				"callback" : function(keyword) {
					console.info(keyword);
				}
			};

			para = $.extend(defaults, options);

			this.init = function() {
				this.createHtml(); // 创建组件html
			};

			/**
			 * 功能:创建上传所使用的html
			 * 参数: 无
			 * 返回: 无 
			 */
			this.createHtml = function() {

				var html = '';
				html += '<b class="search-img"></b>';
				html += '<input id="searchInput" class="search-input" type="text" placeholder="憋说话,搜我~">';
				html += '<button class="search-btn btn">搜索</button>';

				$(self).append(html);

				// 初始化html之后绑定按钮的点击事件
				this.addEvent();
			};


			/**
			 * 功能:绑定事件
			 * 参数: 无
			 * 返回: 无
			 */
			this.addEvent = function() {
				// 判断现在是否在移动设备上或屏幕小的情况下点击
后面还有 109 行代码,购买后查看完整代码

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

AI 解读 AI

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

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