纯JavaScript的渐开式幻灯片
html:
<div id="slide-box">
<div id="slide">
<div id="fbshutter" style="width:1px;">
<img id="bPic" src="images/01.gif" /> </div>
<div id="sPic" style="background:url(images/slide-pic/tab1.gif) no-repeat scroll right top;">
<ul>
<li onclick="javascript:changeImg(5)"></li>
<li onclick="javascript:changeImg(4)"></li>
<li onclick="javascript:changeImg(3)"></li>
<li onclick="javascript:changeImg(2)"></li>
<li onclick="javascript:changeImg(1)"></li>
</ul>
</div><!-- *******************************fbshutter*********************-->
</div>
<p id="pic-content"><a href="#"></a></p>
<p id="intro-more">这里是有关研究所的详细介绍-------->><a href="#">更多</a></p>
<div class="clear"></div>
</div>
js:
<script type="text/javascript">
var gi=1;
setTimeout("tab()",0);
function tab()
{
var s=1;
if(gi>5) gi=1;
if(s==1) setTimeout("changeImg("+gi+")",0);
else{
setTimeout
相关文档:
页面提交数据一般有两种方法:get,post。post就是所谓的form提交,使用视图;get是通过url提交。
Get方法一般用后台代码(如asp,asp.net)获得参数,代码很简单:Request.QueryString["id"];即可获取。
有些时候需要直接在前台获取url参数,要用到javascript,js没有直接获取url参数的方法,那么,我们如何通过js ......
JSON:
[{"subjecttypeId":"1","subjectName":"67","scope":"1",},{"subjecttypeId":"1","subjectName":"345","scope":"1"}]
JavaScript:
var result = window.eval('(' + JSON+ ')');
for(var p in result){
result[p].subjectName;
alert(result[p] ......
原文出处: http://www.dnew.cn/post/196.htm
先看下下面几种写法
1.function f(x){return x*x;};f(x);
2.(function(x){return x*x;})(x);
3.(function(x){return x*x;}(x));
第一种我们应该都很熟悉了,这是我们经常使用的写法。第二第三种都是匿名函数的写法。
------------------------------------------------ ......
<mce:script type="text/javascript"><!--
document.write("<table border=1px border-color=red>"); //表格开始
for (h = 1; h <= 10; h++) {
document.write("<tr>"); //开始第一行
for (s = 1; s <= 10; s++) {
var num = (h-1)*10+s; ......