使用旧版的jquery 1.4.2时,在IE下不响应select的change事件(event),试过很多办法,包括bind(“change click”,…)等等,都没有效果。无意间在使用了.delegate(),意外发现问题得到解决。

在调用$(selector).live(“change”,)前,加入下面的语句:

1195666d1aa22262d4a63417394f00370[......]

Read more

Tags: , , , ,

admin on 六月 16th, 2011

首先下载并安装GO::TermFinder

perl -MCPAN -e shell

cpan> install GO::TermFinder

安装完成之后,至example下载GoView.conf, *.pl,以及examples.html文件。其实这些也已经安装在了本机,你也可以在安装目录下找到。

这里主要介绍使用batchGOView.pl来直接生成报告文件。我们先看一眼batchGoView.pl的原代码。

#读取配置文件
my $confFile = shift;
 
my $conf = &ReadConfFile($confFile);
 
#依据配置文件高置参数
my $ontology = GO::OntologyProvider::OboParser->new(ontologyFile => $conf->{'ontologyFile'},
						    aspect       => $conf->{'aspect'});
 
my $annotation = GO::AnnotationProvider::AnnotationParser->new(annotationFile=>$conf->{'annotationFile'});
 
……
 
my $termFinder = GO::TermFinder->new(annotationProvider=> $annotation,
				     ontologyProvider  => $ontology,
				     aspect            => $conf->{'aspect'},
				     @additionalArgs);
 
#生成报告文件
my $report  = GO::TermFinderReport::Html->new();
&GenerateFrameset;#报告文件规范
 
……
 
#依次读取文件并分析
foreach my $file (@ARGV){
 
    print "Analyzing $file\n";
 
    # 从文件中读取基因列表,从这个命令中我们可以看出,基因文件的格式必须是每行一个基因名这样的格式,中间无空行。
 
    my @genes = GenesFromFile($file);
 
    # 进行从基因名到GO名目的映射。
 
    my @pvalues = $termFinder->findTerms(genes        => \@genes,
					 calculateFDR => $conf->{'calculateFDR'});
 
    # 调用GO::View module来生成报告所需的图片。
 
    my $goView = GO::View->new(-ontologyProvider   => $ontology,
			       -annotationProvider => $annotation,
			       -termFinder         => \@pvalues,
			       -aspect             => $conf->{'aspect'},
			       -configFile         => $confFile,
			       -imageDir           => $conf->{'outDir'},
			       -imageLabel         => "Batch GO::View",
			       -nodeUrl            => $conf->{'goidUrl'},
			       -geneUrl            => $conf->{'geneUrl'},
			       -pvalueCutOff       => $conf->{'pvalueCutOff'});
 
    # 而后将这些结果整合到html中来,以便查看。
 
    my $imageFile;
 
    if ($goView->graph) {
 
	$imageFile = $goView->showGraph;
 
    }
 
    my $htmlFile = &GenerateHTMLFile($file, $goView->imageMap, \@pvalues,
				     scalar($termFinder->genesDatabaseIds), "Terms for $file"); 
 
    print $listFh a({-href   => $htmlFile,
		     -target => 'result'}, $htmlFile), br;
 
}
……

[......]

Read more

Tags: , , , ,

我们知道使用css当中的text-align:justify就可以实现两端对齐了。比如下面这

<div style="text-align: justify; width: 300px">In olden times when wishing still helped one, there lived a king whose daughters were all beautiful; and the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face. Close by the king's castle lay a great dark forest, and under an old lime-tree in the forest was a well, and when the day was very warm, the king's child went out to the forest and sat down by the fountain; and when she was bored she took a golden ball, and threw it up on high and caught it; and this ball was her favorite plaything.</div>

In olden times when wishing still helped one, there lived a king whose daughters were all beautiful; and the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face. Close by the king’s castle lay a great dark forest, and under an old lime-tree in the forest was a well, and when the day was very warm, the king’s child went out to the forest and sat down by the fountain; and when she was bored she took a golden ball, and threw it up on high and caught it; and this ball was her favorite plaything.

我们知道,这种排版很类似Office Word的排版方式。如果有类似TEX的排版,对于这些非等宽字体,就会更好看了。Bram Stein就为我们用javascript实现了这样的功能。

比较我们可以发现,使用javascript的话,排版会更紧凑。其实它更强大之处还在于图文混排。当然那需要更强的图层控制能力。
[......]

Read more

Tags: , , ,

admin on 二月 20th, 2011
  1. 阴影效果

    <img class="shadow" src="sample.jpg" alt="" />

    img.shadow {
    	background: url(shadow-1000x1000.gif) no-repeat right bottom;
    	padding: 5px 10px 10px 5px;
    }

    需要下载图片至css文件目录。

    阴影效果

    阴影效果[/ca[......]

Read more

Tags: ,

admin on 四月 29th, 2010

5快速索引

HTML5 Visual Cheat Sheet (Reloaded)

HTML5口袋书

html5口袋书

html5口袋书

[......]

Read more

Tags: , , ,

admin on 四月 26th, 2010

上次介绍的荧光按钮其实是其于这一次的代码基础上加上了背景特效而已。那么一个漂亮的CSS3按钮应该如何实现呢?

其实很简单。首先确定按钮风格。3的色彩模式为RGBA,RGB大家都很熟悉,A呢其实就是透明度。看代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
.button, .button:visited {
	background: #222 url(overlay.png) repeat-x;
	display: inline-block;
	padding: 5px 10px 6px;
	color: #fff;
	text-decoration: none;
	-moz-border-radius: 6px;
	-webkit-border-radius: 6px;
	-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
	-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
	text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
	border-bottom: 1px solid rgba(0,0,0,0.25);
	position: relative;
	cursor: pointer
}

然后确定按钮的大小。分成small, medium 和 large。

1195666d1[......]

Read more

Tags: , , ,

admin on 四月 23rd, 2010

在safari 4以上的效果最好,FireFox 3.5效果一般。

Read more

Tags: , , ,

admin on 四月 20th, 2010

jQuery以它的易于使用已经改变了人们在开发JavaScript程序时的习惯。如果你有过使用JQuery开发的经历,你就知道使用JQuery,尤其是它的插件会给我们的开发带来如何的便利。在这里,将介绍14个最新的有趣的jQuery插件给大家,这些插件的内容广泛,从网站导航至图像流览,也许会给你带来意外的惊喜。

BubbleUp

使用BubbleUp,可以让你生成一个类似Mac Dock的效果,当鼠标划过时图标变大,当鼠标移出时又回复原样。虽然和最新的Mac Dock的效果还有少少的差距,但也算是不错了。

[......]

Read more

Tags: , , , , ,

admin on 三月 10th, 2010

5标准推出,强调整合的媒体播放器,传说中系统占用率更小。而且这一概念得到了许多人的赞同。但是随着Flash10的推出,人们又开始对这一问题重新进行思考。

Jan Ozer 是一名媒体编码技术员,从1990年开始就一直在这一领域工作,已经出版了13本相关的书。最近,他在Mac和windows上使用几种常用的浏览器对HTML5及Flash10进行了比较,结果和想象的有一些不同,并不是所有时刻HTML5都胜出。Flash的前途会随着技术的进步而保持长青树吗?测试的结果都公布在了StreamingLearningCenter.com.

这里,我们摘录其中关键的表格数据,给你一个快速的印象:

工作在Macintosh上的比较结果

工作在Macintosh OS 10.6.2上的比较结果

[......]

Read more

Tags: , , , ,

admin on 二月 18th, 2010

有的时候,你是否想在网络上做一些问卷调查呢?如果你想完全自己做一个这样的网页,那需要你至少懂一点数据库,以及动态网页技术。这也许对于你来说太麻烦了。

其实有很多在线工具都可以提供问卷调查的服务。你只需要在这些网站上注册并生成表单,然后把生成的代码填入自己的博客或者什么地方,或者你直接使用这个网站的链接,把链接发给朋友也可以。这样就把事情变得简单。你所需要专注的,就是怎么样设计一个合理的问卷。至于表单的外观与后台程序,都由这些在线网站提供就好了。

Wufoo

Wufoo使表单更轻松迅洁有趣

Wufoo使表单更轻松迅洁有趣

[......]

Read more

Tags: , ,