随笔分类 -  JavaScript

摘要:http://juicer.name/docs/docs_zh_cn.html 阅读全文
posted @ 2014-05-21 17:27 Yolandafans 阅读(161) 评论(0) 推荐(0)
摘要:var Jade = {};Jade.util = { addEvent: function (target, eventType, eventHandle, param) { //deal param var regEventHandle = eventHandle if(param) { regEventHandle = function() { eventHandle.call(this, param); } } if (! +"\v1")... 阅读全文
posted @ 2013-07-06 15:28 Yolandafans 阅读(201) 评论(0) 推荐(0)
摘要:出处:http://www.cnblogs.com/sanshi/archive/2009/02/18/1393165.html(感谢三生石上)这是一个基础性的文章,使用Javascript观察DOM中的事件冒泡机制,并介绍如何阻止默认行为和如何组织事件冒泡的方法。1. 第一个例子可以在Firefox下运行<divid="container1"onclick="alert('clickcontainer1');"><divid="container2"onclick="alert(' 阅读全文
posted @ 2013-06-19 09:30 Yolandafans 阅读(184) 评论(0) 推荐(0)
摘要:有时候我们需要操作input,textarera中的光标,现在列举出一些js例子首先看IEIE中的对象是这个 createTextRangevar Range=el.createTextRange();Range.moveEnd('character',el.value.length); Range.moveStart('character',0);//Range.collapse();Range.select();平时我们看到的光标都是合并着的(可以这么理解),它其实包含前后两个光标。moveEnd操作后一个光标,moveStart操作前一个光标。collap 阅读全文
posted @ 2012-03-14 21:30 Yolandafans 阅读(2407) 评论(0) 推荐(1)
摘要:自己封装了一个JS的弹出框。提供的只是一个思想和原理,功能不够完善,当然有需要的话可以逐步添加功能。测试过IE6,7,8和FF和谷歌。页面调用的时候很简单:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title> New Document </title> </head><style> 阅读全文
posted @ 2011-10-31 11:13 Yolandafans 阅读(1624) 评论(0) 推荐(0)