求一个网站首页的迎接画面,就是你访问一个网站你一打开上面显示了加载速度。当加载到100%的时候就自动跳到了首页。个人感觉那个是个FLASH,但是在网上又没找到。哪位兄弟这方面的东西多多发几个来参考下。在下感激不尽,先开100分帖不够的话,说声马上加。谢了,我邮箱[email protected]、、、、、、
在次感谢~~。
在次感谢~~。
解决方案 »
- aspxgridview 翻页后如何取模板列中的控件
- asp.net后台调用脚本,把脚本执行后的值用作和母板页传递数据。
- 如何分行显示textarea中的内容?
- 关于datalist数据绑定后,前台页面根据数据进行动态显示的问题
- 当CheckBox 前面没有打勾时,弹出一个alert,脚本怎么写??
- 在点击DATAGRID中超级连接列中某一格后,如何把它的值传到下一个页面?
- 如何让多个ASP.net站点project共用同一个dll文件,并且这个dll文件不用复制到每个project的Bin目录下面??
- 如何让页面关闭时,该页所有的session均为nothing?
- 今天心情好,开放FTP,可下载可上传,不限线程...
- 我用asp.net开发一个系统,对数据库的操作放在dll里,可是...
- asp.net 客户端通信问题
- 请教:将SQL Server中的资料导出到GridView时行号的问题,详情见内
<script type="text/javascript">
document.write(' <div id=loadDiv >页面正在载入,请等待 </div>');
var setInterval1 = setInterval("loading.innerText += '.'", 100);
var setInterval2 = setInterval("loading.innerText = '.'", 20000);
function window.onload()
{
hiddenDiv.style.display=""; //显示页面内容
loadDiv.removeNode(true);
clearInterval(setInterval1);
clearInterval(setInterval2);
}
</script>html:
<body>
<form id="form1" runat="server">
<div id="hiddenDiv" style="display:none">
..............
</div>
</form>
</body>
<head>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="0">
<title>预加载中....</title>
<style type="text/css">
<!--
.p { font-family: "MS Shell Dlg"; font-size: 12px}
-->
</style>
</head>
<body onLoad="location.href = url" oncontextmenu="window.event.returnValue=false" ondragstart="window.event.returnValue=false" onselectstart="event.returnValue=false">
<script language="JavaScript">
<!--
var url = 'http://www.hldren.com/index.html';
function jump(){
location=url;
return true;
}
//-->
</script>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" width="401" bordercolorlight="#808080" bordercolordark="#FFFFFF">
<tr>
<td bgcolor="#F5F5F5" width="402"> <div id=process style="width: 400; height: 10"> </div>
<script>
var num=0;
function mypro()
{
num++;
process.innerHTML=process.innerHTML+'<font color="#0000FF">■</font>';
if(num<26){setTimeout("mypro()",200);}else{process.innerHTML="";num=0;mypro()}
}
mypro();
</script>
</td> <script>
<!--
if (document.layers)
document.write('<Layer src="' + url + ' " VISIBILITY="hide"> </Layer>');
else
if (document.all || document.getElementById)
document.write('<iframe src="' + url + '" style="visibility: hidden;"></iframe>');
else location.href = url;
//-->
</script>
</tr>
</table>
</center>
</div>
<p align="center"><font class="p"><b>网站正在装载中,请稍候......</b></font></p>
</body>
</html>
程序代码using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace WindowsApplication1
{
/// <summary>
/// Form1 类
/// </summary>
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//用子线程工作
new System.Threading.Thread(new System.Threading.ThreadStart(StartDownload)).Start();
}
//开始下载
public void StartDownload()
{
Downloader downloader = new Downloader();
downloader.onDownLoadProgress += new Downloader.dDownloadProgress(downloader_onDownLoadProgress);
downloader.Start();
}
//同步更新UI
void downloader_onDownLoadProgress(long total, long current)
{
if (this.InvokeRequired)
{
this.Invoke(new Downloader.dDownloadProgress(downloader_onDownLoadProgress), new object[] { total, current });
}
else
{
this.progressBar1.Maximum = (int)total;
this.progressBar1.Value = (int)current;
}
}
} /// <summary>
/// 下载类(您的复杂处理类)
/// </summary>
public class Downloader
{
//委托
public delegate void dDownloadProgress(long total,long current);
//事件
public event dDownloadProgress onDownLoadProgress;
//开始模拟工作
public void Start()
{
for (int i = 0; i < 100; i++)
{
if (onDownLoadProgress != null)
onDownLoadProgress(100, i);
System.Threading.Thread.Sleep(100);
}
}
}
}=================================ling========================================
delegate object dlExecuteQuery();
private void button1_Click(object sender, EventArgs e)
{
dlExecuteQuery de=new dlExecuteQuery(this.Query());
IAsyncResult ir = de.BeginInvoke(null, null);Form f=new Form()
f.ShowDialog(this);
Application.DoEvents();
while (!ir.IsCompleted)
{
Application.DoEvents();
}
object obj = de.EndInvoke(ir);
f.Close();
}private object Query()
{
//长时间的操作
}
using System;
using System.IO ;
using System.Xml ;
using System.Collections ;
using System.Reflection ;
using System.Text ;
using System.Data ;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Threading ;
#endregionnamespace WindowsApplication4
{
/// <summary>
/// Copy Large File
/// </summary>
public class frmMain : System.Windows.Forms.Form
{
#region
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Button btnCopy;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;public frmMain()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}#region Initialize Components
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.btnCopy = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(8, 16);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(208, 16);
this.progressBar1.TabIndex = 0;
//
// btnCopy
//
this.btnCopy.Location = new System.Drawing.Point(8, 48);
this.btnCopy.Name = "btnCopy";
this.btnCopy.TabIndex = 1;
this.btnCopy.Text = "Copy";
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
// frmMain
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(232, 77);
this.Controls.Add(this.btnCopy);
this.Controls.Add(this.progressBar1);
this.Name = "frmMain";
this.Text = "Copy File";
this.ResumeLayout(false);}
#endregion/// <summary>
/// Entry Point
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new frmMain());
}
#endregionint totalSize; //Total Size
int position; //Position
const int BUFFER_SIZE = 4096;
byte[] buffer;
Stream stream;private void btnCopy_Click(object sender, System.EventArgs e)
{
string strFile = "";OpenFileDialog dlg = new OpenFileDialog();
if ( dlg.ShowDialog() == DialogResult.OK )
{
strFile = dlg.FileName ;
}
else
{
return ;
}FileStream fs = new FileStream( strFile , FileMode.Open , FileAccess.Read ) ;
totalSize = (int)fs.Length ;
stream = fs;//Delete file which aready exists.
if ( File.Exists( "c:\\copyedFile.bin" ) )
File.Delete( "c:\\copyedFile.bin" );//Copy file while larger than 4KB.
if ( totalSize > BUFFER_SIZE )
{
buffer = new byte[ BUFFER_SIZE ]; // Async Invoke
stream.BeginRead( buffer , 0 , BUFFER_SIZE , new AsyncCallback( AsyncCopyFile ) , null );
}
else
{
fs.Close();
}}/// <summary>
/// Asynchronously copy file
/// </summary>
/// <param name="ar"></param>
private void AsyncCopyFile( IAsyncResult ar )
{
int readedLength ;// Lock FileStream
lock( stream )
{
readedLength = stream.EndRead( ar ); // When stream endread, get readed length
}// Write to disk
FileStream fsWriter = new FileStream( "C:\\copyedFile.bin" , FileMode.Append , FileAccess.Write );
fsWriter.Write( buffer , 0 , buffer.Length );
fsWriter.Close();// Current stream position
position += readedLength;// Response UI
MethodInvoker m = new MethodInvoker( SynchProgressBar );
m.BeginInvoke( null , null );if ( position >= totalSize ) // Read over.
{
stream.Close(); //Close FileStream
return ;
}// Continue to read and write
lock ( stream )
{
int leftSize = totalSize - position;if ( leftSize < BUFFER_SIZE )
buffer = new byte[ leftSize ];stream.BeginRead( buffer , 0 , buffer.Length , new AsyncCallback( AsyncCopyFile ) , null ); }
}private void SynchProgressBar()
{
this.progressBar1.Maximum = totalSize;
this.progressBar1.Value = position ;
}}
}
<html>
<head>
<title>正在载入...</title>
<meta http-equiv="Content-Type" c>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%">
<tr>
<form name=loading>
<td align=center>
<p><font color=gray>正在载入首页,请稍候.......</font></p>
<p>
<input type=text name=chart size=46 style="font-family:Arial;
font-weight:bolder; color:gray;
background-color:white; padding:0px; border-style:none;">
<br>
<input type=text name=percent size=46 style="font-family:Arial;
color:gray; text-align:center;
border-width:medium; border-style:none;">
<script>var bar = 0
var line = "||"
var amount ="||"
count()
function count(){
bar= bar+2
amount =amount + line
document.loading.chart.value=amount
document.loading.percent.value=bar+"%"
if (bar<99)
{setTimeout("count()",100);}
else
{window.location = "http://www.baidu.com/";}
}
</script>
</p>
</td>
</form>
</tr>
</table>
</body>
</html>
你把一个页面套一个iframe,iframe链接的地址是你要加载的!然后在父页一开始的时候显示进度条,隐藏iframe,等子页面加载完成后,再控制父页面的进度条隐藏,iframe显示。
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<div id='mydiv' >");
Response.Write("_");
Response.Write("</div>");
Response.Write("<script>mydiv.innerText = '';</script>");
Response.Write("<script language=javascript>;");
Response.Write("var dots = 0;var dotmax = 10;function ShowWait()");
Response.Write("{var output; output = '正在装载页面';dots++;if(dots>=dotmax)dots=1;");
Response.Write("for(var x = 0;x < dots;x++){output += '·';}mydiv.innerText = output;}");
Response.Write("function StartShowWait(){mydiv.style.visibility = 'visible'; ");
Response.Write("window.setInterval('ShowWait()',1000);}");
Response.Write("function HideWait(){mydiv.style.visibility = 'hidden';");
Response.Write("window.clearInterval();}");
Response.Write("StartShowWait();</script>");
Response.Flush();
Thread.Sleep(4000);//
//轉到首頁
RESPONSE.REDIRECT("INDEX.ASPX") }
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Web.HttpException: 无法在发送 HTTP 标头之后进行重定向。 你自己去试下就知道了。有没有好看一点的?怎么加载的页面都这么单调。我看到有的网站加载的页面都蛮好看的。
本特效共分3步:
1.在<head></head>中加入:
<STYLE type=text/css>TD {
FONT-SIZE: 9pt
}
.come {
BACKGROUND-COLOR: #eff7d4; BORDER-BOTTOM: #c07a0b 1px dashed; BORDER-LEFT: #c07a0b 1px dashed; BORDER-RIGHT: #c07a0b 1px dashed; BORDER-TOP: #c07a0b 1px dashed; COLOR: #000000; FONT-SIZE: 9pt; HEIGHT: 18px
}
</style>
<SCRIPT language=javascript>
var percent = new Number(0);
function skipmain() {
dopgb();
}
function dopgb() {
var pgb = document.all.pgbdiv.style;
var timeoutID = setTimeout("dopgb()",100);
if (pgb.pixelWidth < 230) pgb.pixelWidth += 5;
percent = parseInt(100 * (pgb.pixelWidth / 230) + 1) + 1;
if (percent > 100) percent = 100;
document.all.perdiv.innerHTML="<p align='center' style='margin-top:0;margin-bottom:0'>" + percent.toString(10) + " %</p>"
if (pgb.pixelWidth >= 230) {
clearTimeout(timeoutID);
window.navigate("http://www.alixixi.com/");
return;
}
}
</SCRIPT>2.将 onload=skipmain() 插入到<body>中例如:<body onload=skipmain()>3.在<body></body>中间加入:
<TABLE align=center border=1 borderColor=#000000 cellPadding=0
cellSpacing=0 height=10
style="BORDER-COLLAPSE: collapse; MARGIN: 10px 0px 0px" width=230
name="pgb_container1">
<TBODY>
<TR>
<TD class=newfont3>
<DIV id=pgbdiv
style="BACKGROUND-COLOR: #65a1ca; HEIGHT: 10px; MARGIN: 0px; TEXT-ALIGN: center; WIDTH: 0px"
border="0"></DIV></TD></TR></TBODY></TABLE>
<P align=center style="MARGIN-TOP: 5px">
<DIV align=center id=perdiv style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px">
<P align=center class=newfont3
style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px">0 %</P></DIV>
<P align=center style="MARGIN: 10px"><INPUT align=center class=come onclick="window.navigate('http://www.alixixi.com/')" style="cursor: hand; width: 140; height: 22" title=我不想等了,直接进入 type=button value=直接进入2259音乐空间>
</P>
怎么就这么懒呢!!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
<title>Start</title>
<style>
.30pt{font-size:30pt;font-family:汉鼎繁特楷;color:black}
.40pt{font-size:30pt;font-family:FetteFraD;color:#de3076}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
var num = new Array(6)
for (var i = 0; i < num.length ; i++) {
num[i] = new Image()
num[i].src ="pictures/mouse/"+i+"i.gif"
}
var nextPage = "Pic.aspx";
function makearray(n)
{
this.length = n;
for(var i = 1; i <= n; i++)
this[i] = 0;
return this;
}hexa = new makearray(16);for(var i = 0; i < 10; i++)
hexa[i] = i;
hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
hexa[13]="d"; hexa[14]="e"; hexa[15]="f";function tohex(i) {
if (i < 0)
return "00";
else if (255 < i)
return "ff";
else
return "" + hexa[Math.floor(i/16)] + hexa[i%16];
}function fade(s_red, s_green, s_blue, e_red, e_green, e_blue, step) {
for(var i = 0; i <= step; i++)
{
document.bgColor="#" + tohex(Math.floor(s_red * ((step-i)/step) + e_red * (i/step)))
+ tohex(Math.floor(s_green * ((step-i)/step) + e_green * (i/step)))
+ tohex(Math.floor(s_blue * ((step-i)/step) + e_blue * (i/step)));
}
}
function countdown(idx)
{
if (idx == 0 )
{
window.status="We go now !";
fade(255,255,255,0,0,0,255);
top.location=nextPage;
}
else
{
window.status=idx+" seconds left";
nextimg=setTimeout("countdown(" + (idx-1) + ")", 1000);
}
} function countdown(idx)
{
if (idx == 0 )
{
document.img.src=num[idx].src;
window.status="We go now !";
fade(255,255,255,0,0,0,100);
location.replace(nextPage);
}
else
{
document.img.src=num[idx].src;
window.status=idx+" seconds left";
nextimg=setTimeout("countdown(" + (idx-1) + ")", 1000);
}
}
-->
</SCRIPT>
</HEAD>
<BODY TEXT="#000000" background="pictures/bg.jpg" BGCOLOR=black LINK="#000099" VLINK="#551A8B" ALINK="#993366">
<CENTER>
<font class=30pt><br>欢迎来到我的主页!</font></br>
<IMG NAME=img SRC="pictures/mouse/logo.gif" HEIGHT=150 WIDTH=150><P>
<font class=40pt>Let's go!</font>
<font class=80pt>我的地盘我做主!现在大家耐心等个5秒种!!!</font>
<FONT SIZE=-1>
<script language=JavaScript>
fade(0, 0, 0, 255, 255, 255, 100);
</script>
<script language=JavaScript>
countID=setTimeout("countdown(5)", 4000); //give 4 sec to load all images to cache
</script>
</FONT>
</CENTER>
</body>
</html>