
Javascript
stefli
简直就是懒人一个
就喜欢下班回家下碟子,看碟子
听听音乐
展开
-
三角*的实现~小小测试~
可以实现自定义高度。呵呵,没事,搞做完~ [CODE] function Draw(n) { var n = parseInt(n); var m=n; for(var i=0;i for(var j=0;j document.write(" "); } for(var p=0;p document.write("*"); } document.write(""); }原创 2004-07-10 12:57:00 · 1001 阅读 · 0 评论 -
JQuery-Rolling effect
$(html,body).animate({scrollTop: 20}, 1000); its perfect!原创 2009-02-10 10:34:00 · 1547 阅读 · 2 评论 -
Freezed header & footer table
There is a freezed header table from internet. but now i modify it to add a freezed footer in the table. "Content-Type" content="text/html; charset=gb2312">固定表头和列"text/css"> #dataTable原创 2008-12-09 17:39:00 · 820 阅读 · 0 评论 -
How to detect the explorer in js
if (!/*@cc_on!@*/0) { //if not IE //Firefox2、Firefox3、Safari3.1+、Opera9.6+ support js.onload} else { //IE6、IE7 support js.onreadystatechange}转载 2009-05-29 13:41:00 · 449 阅读 · 0 评论 -
Observer pattern in Javascript
Just a test Observer Pattern in Javascript <!--function Observer() { this.update = function() { }}function Student(name, teacher) { Observer.call(this); var _name_ =原创 2009-05-29 14:52:00 · 644 阅读 · 0 评论 -
Add new line and delete line using javascript
ADD:var tbl = ;var r = tbl.rows.length;var tr = tbl.insertRow(r);var c0 = tr.insertCell(0);c0.innerText = "test"; DELETE:tbody = tr.parentNode; tbody.removeChild(tr);原创 2010-04-29 17:41:00 · 442 阅读 · 0 评论 -
Build administrative area via Json
<br />We want to build a json string to store the administrative area data, the format would bevar threeSelectData={"省份":{"val":"","items":{"城市":{"val":"","items":{"区县":""}}}},"河北":{"val":"130100","items":{"石家庄市":{"val":"130200","items":{"市辖区":"130101","长安原创 2011-04-18 23:17:00 · 657 阅读 · 0 评论 -
Client-side table sorting for flexigrid
Writer: Dustkicker ----------------------------------------------------------------------------------------I wrote a function to perform sorting of the table loc转载 2011-06-16 14:42:00 · 955 阅读 · 0 评论 -
Continue & break function in .each() function
If you want to do "continue" in an .each() loop, you can use below code segment to implement it. $(div).each(function (index, el) { if (index == 0) { return true; }});原创 2011-06-22 10:24:00 · 707 阅读 · 0 评论 -
Three linkage menu for Province, City, County
To load adzone faster, we need to use ajax to load the province, city or county when its parent changed.Here is the major code:1. Main page<%@ page language="java" contentType="text/html; chars原创 2011-06-23 17:46:00 · 1956 阅读 · 0 评论 -
How to open the dialog out of iframe by using jquery dialog
The solution is from http://stackoverflow.com Once, i want to trigger the dialog in iframe, and want it to be openned in the parent page. but it always displayed in the iframe. Here is a solut转载 2011-06-23 10:06:00 · 1469 阅读 · 0 评论 -
Display the google map in jQuery ui dialog
Use the default settings, the google map can be displayed in a separate page. But, cant be displayed in the jQuery dialog. After debug in Firebug, i found that the major javascripts are never be load原创 2011-06-30 15:48:00 · 1280 阅读 · 0 评论 -
Create menu by javascript dynamically
There are many ways to create menu dynamically:1. Spit url by "/", then create menu for each part.You can search the solution from internet,原创 2011-07-27 13:24:46 · 693 阅读 · 0 评论 -
Keycode list
Just for reminder.key: { a: {code: 65}, b: {code: 66}, c: {code: 67}, d: {code: 68}, e: {code: 69}, f: {code: 70}, g: {code:转载 2011-08-01 17:17:38 · 708 阅读 · 0 评论 -
OuterHTML implementation in Firefox
<br />Here is a sample:<br /><html><head><title>FireFox OuterHTML Implementation</title><mce:script type="text/javascript"><!--if(typeof转载 2010-12-09 10:11:00 · 452 阅读 · 0 评论 -
A mask of the web~
this is a simple realization of mask. the code as below:>html>head>title> New Document title>meta name="Generator" content="EditPlus">meta name="Author" content="">meta name="Keywords" content="">meta原创 2008-10-13 14:41:00 · 742 阅读 · 0 评论 -
Synchronize the height of iframe and parent
Just a test!Tips:o.height = ifr.h;can not be changed with:o.height = o.h;Parent[iframe.html]>html>head>title> New Document title>style>body { padding: 0px; margin: 0px;}style>script>var h;script原创 2008-10-28 17:09:00 · 527 阅读 · 0 评论 -
取得文章中的URL地址~
最好的办法就是使用正则表达式来比配获得~ [CODE] function getUrl(){ var str = document.all.stefli.value; var re = /http:////([/w-]+/.)+[/w-]+(//[/w- .//?%&=]*)?/gi; var len = str.match(re).length; for(var i=0;i { alert(s原创 2004-07-15 14:03:00 · 2259 阅读 · 0 评论 -
横向菜单和竖向菜单~
[CODE] function show(obj){eval("menu"+obj).style.visibility="visible";} function hidden(obj){eval("menu"+obj).style.visibility="hidden";}//--> 竖向菜单 网页设计 图象处理 超酷源码 作品展示 给我留言 酷设网v1原创 2004-07-21 14:00:00 · 1607 阅读 · 0 评论 -
简单的横向菜单测试
[CODE] "http://www.w3.org/TR/html4/loose.dtd">横向另类菜单//--Designer: Stefli//--Date: 2004-7-22//--Address: Shenzhenvar preid = 1;function showMenu(id) {var osubMenu = eval("document.all.subMenu"+id);osub原创 2004-07-22 09:39:00 · 1056 阅读 · 0 评论 -
文章中的代码演示功能~
对于学习js有很大的帮助 [CODE] function Run() { var str = document.all.stefli.value; var re = /(/[STEFLICODE])(.[^/[]+)(/[//STEFLICODE])/i; var html = str.replace(re,"$2"); var obj = window.open("","_blank","")原创 2004-07-30 17:34:00 · 1095 阅读 · 0 评论 -
(js)数值转人民币大写的程序!--我也来个
看了“zhaoxiaoyang (梅雪香) ”写的,我也手痒咯,就写了一个玩玩,程序比他少点而已~//-----------------------------------------------------------------------////---Editor:Stefli//---QQ:3326848//---WebSite:http://www2.gliet.edu.cn/gdh原创 2004-08-26 14:24:00 · 1276 阅读 · 1 评论 -
常用长宽高~
s += "/r/n网页可见区域宽:"+ document.body.clientWidth; s += "/r/n网页可见区域高:"+ document.body.clientHeight; s += "/r/n网页可见区域高:"+ document.body.offsetWeight +" (包括边线的宽)"; s += "/r/n网页可见区域高:"+ doc原创 2004-11-10 16:22:00 · 1225 阅读 · 0 评论 -
alt的特殊显示方式
//标题处理开始//***********默认设置定义.*********************tPopWait=50;//停留tWait豪秒后显示提示。tPopShow=1000;//显示tShow豪秒后关闭提示showPopStep=20;popOpacity=99;//***************内部变量定义*****************sPop=null;curShow=null;原创 2004-11-30 14:12:00 · 1179 阅读 · 0 评论 -
JAVASCRIPT加密解密终级指南
本文一共介绍了七种方法: 一:最简单的加密解密 二:转义字符"/"的妙用 三:使用Microsoft出品的脚本编码器Script Encoder来进行编码 (自创简单解码) 四:任意添加NUL空字符(十六进制00H) (自创) 五:无用内容混乱以及换行空格TAB大法 六:自写解密函数法 七:错误的利用原创 2005-01-19 16:11:00 · 1764 阅读 · 0 评论 -
A modified version of a good lrc player.
This is a good lrc player which is designed by 李国强.There is a requirement in csdn forum that somebody wants to modify this program,then it can show 8 lines lrc in the player.So i just make a little mo原创 2008-09-26 22:35:00 · 963 阅读 · 0 评论 -
A test of javascript's inheritance
This is a simple test of javascripts inheritance,you also can change the "apply" method to "call". the result is same. html>head>title>Javascript Class extend testtitle>meta name="Gen原创 2008-09-28 23:35:00 · 593 阅读 · 0 评论 -
A javascript selector
This is a selector,but there is a problem that it will show an error when you click the body quickly in IE. its done in FF.i will modifiy it at spare time. If you have some advice,please let me know原创 2008-09-28 17:39:00 · 713 阅读 · 0 评论 -
如何优化JavaScript脚本的性能
作者:ShiningRay @ Nirvana Studio随着网络的发展,网速和机器速度的提高,越来越多的网站用到了丰富客户端技术。而现在Ajax则是最为流行的一种方式。JavaScript是一种解释型语言,所以能无法达到和C/Java之类的水平,限制了它能在客户端所做的事情,为了能改进他的性能,我想基于我以前给JavaScript做过的很多测试来谈谈自己的经验,希望能帮助大家改进自己的Ja转载 2008-09-29 03:09:00 · 2108 阅读 · 4 评论 -
How to create a javascript class~
在Javascript中构建一个类有好几种方法: 1.Factory 方式 function createCar(){ var car = new Object(); car.color="b"; car转载 2008-10-08 10:37:00 · 627 阅读 · 0 评论 -
Javacript OOP
目录:一、公有/私有的变量及方法二、继承三、附录 内容:一、 公有/私有的变量及方法本部分使用例子 Person演示如何在 Javascript 类中创建属于类的变量及方法。部分二阐述Javascript 中类的继承。摘要私有变量 使用关键字 ‘var’ 在对象内部定义, 变量可访问范围为对象内部、内部私有函数,特有方法。私有转载 2008-10-08 10:50:00 · 1331 阅读 · 1 评论 -
Translate C++ Dijkstra to Javascript version
The C++ Dijkstra is at:http://www.cnblogs.com/tanky_woo/archive/2011/01/19/1939041.htmlCalculate the path from 1 to 5!Here is the Javascript version which is translated from above vers原创 2011-12-02 13:01:20 · 1530 阅读 · 0 评论