百度首页 | 百度空间
 
文章列表
 
您正在查看 "js小技术" 分类下的文章

2008年06月24日 星期二 13:22

转自时尚杯子的百度空间,哈哈

[横的]
---------------------------------------------
<div id=demo style=overflow:hidden;height:120;width:600;color:#ffffff><table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td><img src=jsimg/1.jpg width=150 height=100></td>
<td><img src=

类别:js小技术 | 评论(0) | 浏览()
 
2008年06月19日 星期四 09:11
cookies读写的功能
//写cookies
fu
类别:js小技术 | 评论(0) | 浏览()
 
2008年06月06日 星期五 17:07

针对高级用户,TinyMCE 有一个全局实例,可以在页面中调用它的公共函数。

tinyMCE.triggerSave([skip_cleanup], [skip_callback]);

对内容进行清除,并将编辑器内容放回到表单中。通过在表单提交方法中增加触发器,tinyMCE 会自动调用此函数。

参数
[skip

类别:js小技术 | 评论(0) | 浏览()
 
2008年06月06日 星期五 11:43

删除select中的所有OPTION

document.getElementById("select的ID").options.length = 0;

为select添加一个option

document.getElementById("select的ID").options.add(new Option(text,value));

移除一个指定的OPTION

document.getElementById("select的ID").remove(i);

类别:js小技术 | 评论(0) | 浏览()
 
2008年05月29日 星期四 16:33

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>

类别:js小技术 | 评论(1) | 浏览()
 
2008年05月09日 星期五 15:17

document.body.offsetHeight

以上代码可以取到屏幕的高度,但是当你在页面中有

<!DOCTYPE html PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

这些代码的时候,这个东西就不管用啦,这时候,你可以用以下方法取页面高度:

在页面中加入

var bdy = (doc

类别:js小技术 | 评论(1) | 浏览()
 
2008年04月24日 星期四 14:31
//返回元素位置top,left,right,bottom
//传入元素object
//返回封装信息,如取top,则getPosition(o).top
function getPosition(o)
{
    var temp={};
    temp.left=temp.right=temp.top=temp.bottom=0;
    var oWidth=o.offsetWith,oHeight=o.offsetheight;
    while(o!=document.body)
    {
        temp.left+=o.offsetLeft;
    
类别:js小技术 | 评论(0) | 浏览()
 
2008年04月21日 星期一 16:53

由 John Resig 的 How JavaScript Timers Work 可以知道,现有的 JavaScript 引擎是单线程处理任务的。它把任务放到队列中,不会同步去执行,必须在完成一个任务后才开始另外一个任务。

让我们看看我之前的文章:JavaScript的9个陷阱及评点,在第 9 点 Focus Pocus 中提到的问题。原作者对这个认识有所偏差,其实不只是 IE 的问题,而是现有 JavaScript 引擎对于线程实现的问题(关于线程,我的概念其实不多,如果不对,希望读者多多指教

类别:js小技术 | 评论(1) | 浏览()
 
2008年04月07日 星期一 15:07

        function aaa(){
            var evt = getEvent();
            alert(evt.clientX);
            return false;
        }
        
        function

类别:js小技术 | 评论(0) | 浏览()
 
2008年04月02日 星期三 13:35
//随机改变数组的排序
function randomOrder (targetArray)
{
    var arrayLength = targetArray.length
    //
    //先创建一个正常顺序的数组
    var tempArray1 = new Array();

    for (var i = 0; i < arrayLength; i ++)
    {
        tempArray1 [i] = i
    }
    //
   
类别:js小技术 | 评论(0) | 浏览()
 
     
 
 
文章分类
 
 
 
Ajax(5)
 
 
 
 
 
 
 
 
Css(7)
 
 
 
 
     
 
文章存档
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
     
 
最新文章评论
   

AJAX,好东西啊
 

3Q
 

你是干什么的?
 

问题自己解决了

 

大哥,我用的是ACCESS怎么弄?
 
     


©2008 Baidu