定时提示问题(高分交流)

jasondct 2007-10-17 05:07:41
asp.net(2005);在一个网页上定义一个时间段内,弹出一个网页,这个弹出的网页有振动屏幕的功能。呵呵在线等最佳方案
...全文
204 26 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
26 条回复
切换为时间正序
请发表友善的回复…
发表回复
jasondct 2007-11-04
  • 打赏
  • 举报
回复
哈哈 ok 弹出页面是这样啊 楼上的
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>

<!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 runat="server">
<style>
#quakenotice_ie{
font:normal 14px Arial;
position:absolute;
width:300px;
height:55px;
border:2px solid black;
background-color:lightyellow;
visibility:hidden;
}
</style>
</head>
<body onLoad="earthquake()">
<layer id="quakenotice_ns" width=300 height=55 bgColor=lightyellow visibility=hide></layer>
<script>

/*
EarthQuake script- ?Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
Visit http://dynamicdrive.com
*/

//configure the likelihood that an earthquake will occur (100% means always)
var chance_of_occurence="50%"

/////do NOT edit below this line/////////////

//variable used to store the equivalency of the 10 rector scales (in the form of 1, 3, 6...etc)
var rectorscale=new Array(1,3,6,9,12,15,18,21,24,27)
chance_of_occurence=parseInt(chance_of_occurence)

function earthquake(){
//randomly assign a number from 1 to 10 to variable rectorindex
rectorindex=Math.floor(Math.random()*10)
//randomly assign one of element rectorscale into variable rector
rector=rectorscale[rectorindex]
if ((document.all||document.layers)&&Math.floor(Math.random()*100)<=chance_of_occurence) {
//shake the browser's screen according to the random rector scale!
for (i=0;i,i<20;i++){
window.moveBy(0,rector)
window.moveBy(rector,0)
window.moveBy(0,-rector)
window.moveBy(-rector,0)
}
// show quake message
quakealert()
}
}

if (document.all)
document.write('<div id="quakenotice_ie"></div>')

function quakealert(){
var quakemessage='An earthquake of magnitude <b>'+eval(rectorindex+1)+'</b> has just occured! Please stay calm...everything\'s fine now.'

if (document.all){
quakemsg_ie=document.all.quakenotice_ie
quakemsg_ie.innerHTML=quakemessage
//position quake message in center of screen
quakemsg_ie.style.left=document.body.scrollLeft+document.body.clientWidth/2-quakemsg_ie.offsetWidth/2
quakemsg_ie.style.top=document.body.scrollTop+document.body.clientHeight/2-quakemsg_ie.offsetHeight/2
quakemsg_ie.style.visibility="visible"
setTimeout("quakemsg_ie.style.visibility='hidden'",5000)
}
else if (document.layers){
quakemsg_ns=document.quakenotice_ns
quakemsg_ns.document.write(quakemessage)
quakemsg_ns.document.close()
quakemsg_ns.left=pageXOffset+window.innerWidth/2-quakemsg_ns.document.width/2
quakemsg_ns.top=pageYOffset+window.innerHeight/2-quakemsg_ns.document.height/2
quakemsg_ns.visibility="show"
setTimeout("quakemsg_ns.visibility='hide'",5000)
}
}
</script>
</body>
</html>
zhangxia_dct 2007-11-04
  • 打赏
  • 举报
回复
function openwindows()
{
window.open(Default.aspx, "toolbar=no, status=yes,
left=150,top=150,width= "+iWidth+ ",
height= "+ iHeight+ ",scrollbars=yes,resizable=1 ");
}

//每隔15秒打开在openwindows()中定义所要打开的页面;
setInterval( "openwindows() ", 15000);
注意你要打开页面的函数打开。

震动的窗口简单拉
.将下面的代码复制到<head> 内
<style>
#quakenotice_ie{
font:normal 14px Arial;
position:absolute;
width:300px;
height:55px;
border:2px solid black;
background-color:lightyellow;
visibility:hidden;
}
</style>
将下面的代码复制到 <body> 内
<layer id="quakenotice_ns" width=300 height=55 bgColor=lightyellow visibility=hide></layer>
<script>

/*
EarthQuake script- ?Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
Visit http://dynamicdrive.com
*/

//configure the likelihood that an earthquake will occur (100% means always)
var chance_of_occurence="50%"

/////do NOT edit below this line/////////////

//variable used to store the equivalency of the 10 rector scales (in the form of 1, 3, 6...etc)
var rectorscale=new Array(1,3,6,9,12,15,18,21,24,27)
chance_of_occurence=parseInt(chance_of_occurence)

function earthquake(){
//randomly assign a number from 1 to 10 to variable rectorindex
rectorindex=Math.floor(Math.random()*10)
//randomly assign one of element rectorscale into variable rector
rector=rectorscale[rectorindex]
if ((document.all||document.layers)&&Math.floor(Math.random()*100)<=chance_of_occurence) {
//shake the browser's screen according to the random rector scale!
for (i=0;i,i<20;i++){
window.moveBy(0,rector)
window.moveBy(rector,0)
window.moveBy(0,-rector)
window.moveBy(-rector,0)
}
// show quake message
quakealert()
}
}

if (document.all)
document.write('<div id="quakenotice_ie"></div>')

function quakealert(){
var quakemessage='An earthquake of magnitude <b>'+eval(rectorindex+1)+'</b> has just occured! Please stay calm...everything\'s fine now.'

if (document.all){
quakemsg_ie=document.all.quakenotice_ie
quakemsg_ie.innerHTML=quakemessage
//position quake message in center of screen
quakemsg_ie.style.left=document.body.scrollLeft+document.body.clientWidth/2-quakemsg_ie.offsetWidth/2
quakemsg_ie.style.top=document.body.scrollTop+document.body.clientHeight/2-quakemsg_ie.offsetHeight/2
quakemsg_ie.style.visibility="visible"
setTimeout("quakemsg_ie.style.visibility='hidden'",5000)
}
else if (document.layers){
quakemsg_ns=document.quakenotice_ns
quakemsg_ns.document.write(quakemessage)
quakemsg_ns.document.close()
quakemsg_ns.left=pageXOffset+window.innerWidth/2-quakemsg_ns.document.width/2
quakemsg_ns.top=pageYOffset+window.innerHeight/2-quakemsg_ns.document.height/2
quakemsg_ns.visibility="show"
setTimeout("quakemsg_ns.visibility='hide'",5000)
}
}
</script>
visibility:hidden;
}
</style>
jasondct 2007-10-26
  • 打赏
  • 举报
回复
今天结贴。在再期待
jasondct 2007-10-25
  • 打赏
  • 举报
回复
接着顶
jasonlee0927 2007-10-24
  • 打赏
  • 举报
回复
帮顶
JYYCOM 2007-10-24
  • 打赏
  • 举报
回复
帮顶,顺便做个记号
jasondct 2007-10-24
  • 打赏
  • 举报
回复
呵呵 要结贴了。期盼各位同仁给点解决方案代码
exiori 2007-10-19
  • 打赏
  • 举报
回复
JS
yuan74521940 2007-10-19
  • 打赏
  • 举报
回复
使弹出的子窗口具有震动效果


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
窗口振动
</title>
<script language="javascript" type="text/javascript">
var flag = 1,o = null;
win=window.open('','Shake','toolbar=no');
function ShakeWindow(){
if (flag == 1){
win.moveTo(5, 5);
flag = 2;
} else {
win.moveTo(0, 0);
flag = 1;
}
}
function start(){
if (o != null) return;
o = window.setInterval("ShakeWindow()",20);
}
function Stop(){
clearTimeout(o);
o=null;
}

win.document.writeln('<script>document.attachEvent("onmouseover",opener.start);document.attachEvent("onmouseout",opener.Stop);<\/script><title>Test</title><body></body>');
</script>
</head>
<body>
</body>
</html>

定时弹出一个网页............LZ会了!..我只给你提供效果!!
这个是你要的?
symbol441 2007-10-19
  • 打赏
  • 举报
回复
mark一下
mextb1860 2007-10-19
  • 打赏
  • 举报
回复
那显示器放在按摩器上。然后设置一下按摩器,就可以疯狂的震动了。还可以给显示器按摩。看效果还是得看疗效。哈哈
gdipkf1986 2007-10-19
  • 打赏
  • 举报
回复
应该是你想的那种方法


function openwindows()
{
var newwin=window.open("Default.aspx","winname");
for(i=0;i<10;i++){
newwin.moveBy(i%2==1?10:-10,i%2==1?10:-10);
}

}
//每隔15秒打开在openwindows()中定义所要打开的页面;
setInterval("openwindows()",1500);


软若石 2007-10-19
  • 打赏
  • 举报
回复
以前见过有震动屏幕的js代码。
mysky0103 2007-10-19
  • 打赏
  • 举报
回复
mark
jasondct 2007-10-19
  • 打赏
  • 举报
回复
有没有好的方法,交流一下啊
jasondct 2007-10-19
  • 打赏
  • 举报
回复
谢谢15楼,拿出自己的代码给大家分享,为提高我们共同水平,希望再有人来交流。快结贴了。
jasondct 2007-10-18
  • 打赏
  • 举报
回复
呵呵 ,当然是异性了。
我的方式是这样的
function openwindows()
{
window.open(Default.aspx,"toolbar=no, status = yes,left=150,top=150,width="+iWidth+", height="+ iHeight +", scrollbars=yes, resizable = 1");
}
//每隔15秒打开在openwindows()中定义所要打开的页面;
setInterval("openwindows()", 15000);

感觉不好, 所以就拿来交流了,共同提高了。 振动屏幕也是用的js 但是我水平有限 我总认为有好的方式,我不知道所以就来请教了。
Cherish20 2007-10-18
  • 打赏
  • 举报
回复
前面的确好实现,只要在程序启动的时候定义一个定时器就可以了,
但后面这个问题有办法,就是循环了,
控制执行时间即可。
xing98218 2007-10-18
  • 打赏
  • 举报
回复
用setInterval方法进行控制
WNASP 2007-10-18
  • 打赏
  • 举报
回复
我也很关注这个问题

我的解决办法就是用javascript设置定时显示出div,或者弹出窗口
因为客户端无法受到服务端的控制
不知道还有没有其他的高见?
加载更多回复(6)

62,243

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧