几个关于高效工作的建议

七月 28, 2006

(0) 评论

转载:布鲁斯狼

防止浪费时间的窍门

If the real work that needs doing is offline, disable the internet for an hour at a time.
如果这件事情不需要上网就可以完成,把网断掉。

Turn email checks into an hourly habit, not an “as the box gets mail” habit.
延长查看电子邮件的周期。

Don’t answer your cell phone when working on something important. Call back later.
如果手头的工作很重要,工作期间不要接电话,回头再打过去就是了。

If you can’t work at work, negotiate finding a new place to get things done.
如果你的工作环境让你不能工作,换个没人打扰的地方 

Television means: “I don’t need this time and it doesn’t matter to me.” (Almost always. Really.)
看电视意味着“这段时间我浪费了也无所谓”。

查看全文>>

分类: English, 工作

标签: , ,

一个不错的JS折叠效果

七月 25, 2006

(0) 评论

先点击这里看下效果吧

用法:

1.添加JS库(点击下截):

<script src="prototype.lite.js" type="text/javascript"></script>
<script src="moo.fx.js" type="text/javascript"></script>
<script src="moo.fx.pack.js" type="text/javascript"></script>

2.建立xhtml结构:

<div id="container">
    <H1 class="title">
        <A href="javascript:void(0)">(1)这里放标题
    </H1>
    <div class="content">
        <p>(1)这里放内容</p>
    </div>
    <H1 class="title">
        <A href="javascript:void(0)">(2)这里放标题
    </H1>
    <div class="content">
        <p>(2)这里放内容</p>
    </div>
    <H1 class="title">
        <A href="javascript:void(0)">(3)这里放标题
    </H1>
    <div class="content">
        <p>(3)这里放内容</p>
    </div>
</div>

3.调用JS:

<script type="text/javascript">
    //定义contents 组数为所有将要显示的内容
    var contents = document.getElementsByClassName('content');
    //定义contents 组数为所有标题,也是可点击展开的按钮
    var toggles = document.getElementsByClassName('title');
 
    //调用moofx JS库
    var myAccordion = new fx.Accordion(
        //opacity确定是否有alpha透明变化,duration确定动作所有时间
        toggles, contents, {opacity: true, duration: 400}   
    );
    //默认打开第一个内容
    myAccordion.showThisHideOpen(contents[0]);
</script>

完成.
简单而且效果不错吧
如果还要界面好看点,自已定义下CSS吧

分类: Ajax

标签: , ,

前些日子搜来的好东西

七月 20, 2006

(0) 评论

一个Javascript 的类库,用于table内容排序。使用很方便,不用每次都去调用数据库了。
特别适合多表查询的排序。加上<tbody>的style.display 切换,也可以实现分页。
点击标题排序

Name Salary Extension Start date
Turvey, Kevin $191200.00 2342 02/05/1979
Shakespeare, Hamnet $9000 9005 01/01/2002
Shakespeare, Bill $122000.00 3211 12/11/1961
Mbogo, Arnold $32010.12 2755 09/08/1998
Fitz, Marvin $3300 5554 22/05/1995
Bloggs, Fred $12000.00 1353 18/08/2003

 

用法:

1.添加JS JS 下载地址

<script src="sorttable.js" type="text/javascript"></script>

2.添加TABLE,注意的是:一定要有ID,class为”sortable”

<table class="sortable" id="mytable">

OK,可以了,简单的吧

如果觉得太单调,自己加点CSS吧,官方给出了改HEAD的CSS

/* Sortable tables */
table.sortable a.sortheader {
    background-color:#eee;
    color:#666666;
    font-weight: bold;
    text-decoration: none;
    display: block;
}
table.sortable span.sortarrow {
    color:black;
    text-decoration: none;
}

分类: Ajax

标签: , , ,