广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 2606 个阅读者
 
发表文章 发表投票 回覆文章
  可列印版   加为IE收藏   收藏主题   上一主题 | 下一主题   
long691216
数位造型
个人文章 个人相簿 个人日记 个人地图
路人甲
级别: 路人甲 该用户目前不上站
推文 x0 鲜花 x0
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片
推文 x0
[HTML][讨论] 请问window.onload跟BODY onload会冲到该怎么解决阿[以解决]
小弟是学网页的新手  烦请哪一位大大教教小弟

第一个  这是一个闪烁文字的SCRIPT
<style>
<!--
#glowtext{
filter:glow(color=0A9DF5,strength=2);
width:100%;
}
-->
</style>
<script language="JavaScript1.2">
function glowit(which){
if (document.all.glowtext[which].filters[0].strength==2)
document.all.glowtext[which].filters[0].strength=1
else
document.all.glowtext[which].filters[0].strength=2
}
function glowit2(which){
if (document.all.glowtext.filters[0].strength==2)
document.all.glowtext.filters[0].strength=1
else
document.all.glowtext.filters[0].strength=2
}
function startglowing(){
if (document.all.glowtext&&glowtext.length){
for (i=0;i<glowtext.length;i++)
eval('setInterval("glowit('+i+')",150)')
}
else if (glowtext)
setInterval("glowit2(0)",150)
}
if (document.all)
window.onload=startglowing
</script>
<span id="glowtext"><font color="F5D20A" " face="细明体" size="3">热门商品</font></span> <style>
<!--
#glowtext{
filter:glow(color=0A9DF5,strength=2);
width:100%;
}
-->
</style>
<script language="JavaScript1.2">
function glowit(which){
if (document.all.glowtext[which].filters[0].strength==2)
document.all.glowtext[which].filters[0].strength=1
else
document.all.glowtext[which].filters[0].strength=2
}
function glowit2(which){
if (document.all.glowtext.filters[0].strength==2)
document.all.glowtext.filters[0].strength=1
else
document.all.glowtext.filters[0].strength=2
}
function startglowing(){
if (document.all.glowtext&&glowtext.length){
for (i=0;i<glowtext.length;i++)
eval('setInterval("glowit('+i+')",150)')
}
else if (glowtext)
setInterval("glowit2(0)",150)
}
if (document.all)
window.onload=startglowing
</script>
<span id="glowtext"><font color="F5D20A" " face="细明体" size="3">热门商品</font></span>


第二个   这是会跳出视窗的SCRIPT

<SCRIPT>
<!--
var flyingwin
var popupwidth=200
var popupheight=150
var marginright
var windowcenter
var i_top=200
var i_left=-popupwidth-50
var step=40
var timer
var waitingtime=5000
var pause=20

function showWindow() {
    flyingwin = window.open("", "flyingwin", "toolbar=no,width="+popupwidth+",height="+popupheight+",top=100,left="+(-popupwidth)+"");
    flyingwin.document.open();
    flyingwin.document.write("<html><title>自动离开的窗口</title><body><p align=center>请不要关闭,我马上就自动滚蛋:(</body></html>");
    flyingwin.document.close();
   
    if (document.all) {
        marginright = screen.width+50
    }
    if (document.layers) {
        marginright = screen.width+50
    }
    windowcenter=Math.floor(marginright/2)-Math.floor(popupwidth/2)
    movewindow()
       
}

function movewindow() {
        if (i_left<=windowcenter) {
              flyingwin.moveTo(i_left,i_top)
              i_left+=step
              timer= setTimeout("movewindow()",pause)
        }
        else {
              clearTimeout(timer)
              timer= setTimeout("movewindow2()",waitingtime)
        }
}

function movewindow2() {
        if (i_left<=marginright) {
              flyingwin.moveTo(i_left,i_top)
              i_left+=step
              timer= setTimeout("movewindow2()",pause)
        }
        else {
              clearTimeout(timer)
              flyingwin.close()
        }
}

// -->
</SCRIPT>
<BODY onload=showWindow()></BODY>


小弟真的不懂body onload 跟window.onload  会冲到的原因  希望各位能给小弟一点意见

感激不尽

表情


[ 此文章被kc715在2005-03-28 13:21重新编辑 ]



献花 x0 回到顶端 [楼 主] From:台湾中华电信 | Posted:2005-03-28 05:47 |
kc715 手机
个人文章 个人相簿 个人日记 个人地图
初露锋芒
级别: 初露锋芒 该用户目前不上站
推文 x0 鲜花 x73
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

请参考附件的原始档内容....

基本上并没有冲到喔..............


本帖包含附件
txt test.htm.txt   (2022-06-09 14:01 / 3 KB)   下载次数:14


小弟的拙作,如何救回误删的资料

资料抢救大作战!教您用Finaldata Enterprise2

进阶认识代理伺服器proxy

======================

度德以处之,量力而行之,相时而动。
明恕而行,要之以礼。

======================
献花 x0 回到顶端 [1 楼] From:台湾中华电信 | Posted:2005-03-28 13:20 |
long691216
数位造型
个人文章 个人相簿 个人日记 个人地图
路人甲
级别: 路人甲 该用户目前不上站
推文 x0 鲜花 x0
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

下面是引用kc715于2005-03-28 13:20发表的 :
请参考附件的原始档内容....

基本上并没有冲到喔..............

可是字不会动阿   还有视窗也不会出现   好无奈喔   

//自动离开的窗口
<SCRIPT>
<!--
var flyingwin
var popupwidth=200
var popupheight=150
var marginright
var windowcenter
var i_top=200
var i_left=-popupwidth-50
var step=40
var timer
var waitingtime=5000
var pause=20

function showWindow() {
     flyingwin = window.open("", "flyingwin", "toolbar=no,width="+popupwidth+",height="+popupheight+",top=100,left="+(-popupwidth)+"");
     flyingwin.document.open();
     flyingwin.document.write("<html><title>自动离开的窗口</title><body><p align=center>请不要关闭,我马上就自动滚蛋:(</body></html>");
     flyingwin.document.close();
     
     if (document.all) {
           marginright = screen.width+50
     }
     if (document.layers) {
           marginright = screen.width+50
     }
     windowcenter=Math.floor(marginright/2)-Math.floor(popupwidth/2)
     movewindow()
           
}

function movewindow() {
           if (i_left<=windowcenter) {
                 flyingwin.moveTo(i_left,i_top)
                 i_left+=step
                 timer= setTimeout("movewindow()",pause)
           }
           else {
                 clearTimeout(timer)
                 timer= setTimeout("movewindow2()",waitingtime)
           }
}

function movewindow2() {
           if (i_left<=marginright) {
                 flyingwin.moveTo(i_left,i_top)
                 i_left+=step
                 timer= setTimeout("movewindow2()",pause)
           }
           else {
                 clearTimeout(timer)
                 flyingwin.close()
           }
}
</SCRIPT>
<BODY onload=showWindow()></BODY>



------------------------

//心跳样式的文字

<style>
<!--
#glowtext{
filter:glow(color=0A9DF5,strength=2);
width:100%;
}
-->
</style>
<script language="JavaScript1.2">
function glowit(which){
if (document.all.glowtext[which].filters[0].strength==2)
document.all.glowtext[which].filters[0].strength=1
else
document.all.glowtext[which].filters[0].strength=2
}
function glowit2(which){
if (document.all.glowtext.filters[0].strength==2)
document.all.glowtext.filters[0].strength=1
else
document.all.glowtext.filters[0].strength=2
}
function startglowing(){
if (document.all.glowtext&&glowtext.length){
for (i=0;i<glowtext.length;i++)
eval('setInterval("glowit('+i+')",150)')
}
else if (glowtext)
setInterval("glowit2(0)",150)
}
if (document.all)
window.onload=startglowing
</script>
<span id="glowtext"><font color="F5D20A" " face="细明体" size="3">心跳样式的文字</font></span>


单独都可以执行   但是串在一起自动消失的视窗不会出来  文字也不会闪烁

麻烦大大帮小弟解惑一下


献花 x0 回到顶端 [2 楼] From:台湾中华电信 | Posted:2005-03-28 15:09 |
kc715 手机
个人文章 个人相簿 个人日记 个人地图
初露锋芒
级别: 初露锋芒 该用户目前不上站
推文 x0 鲜花 x73
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

您好,小妹认为这一段应该放在<body> </body>之间

<span id="glowtext"><font color="F5D20A" " face="细明体" size="3">热门商品</font></span> <style>
<!--
#glowtext{
filter:glow(color=0A9DF5,strength=2);
width:100%;
}
-->
</style>

因为<BODY>内含的是网页显示的内容.....
基本上你的原始码本身没啥问题

我楼上那篇就是这样放的


小弟的拙作,如何救回误删的资料

资料抢救大作战!教您用Finaldata Enterprise2

进阶认识代理伺服器proxy

======================

度德以处之,量力而行之,相时而动。
明恕而行,要之以礼。

======================
献花 x0 回到顶端 [3 楼] From:台湾中华电信 | Posted:2005-03-28 15:34 |
xxxzzz
个人头像
个人文章 个人相簿 个人日记 个人地图
初露锋芒
级别: 初露锋芒 该用户目前不上站
推文 x0 鲜花 x46
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

我直接改kc715大大的
试试下面的代码..两种效果都有
重点在于把会闪的代码放在</body>后面
然后把window.onload=startglowing
改成startglowing();

没有很仔细看...应该还有其他方法
复制程式
<style>
<!--
#glowtext{
filter:glow(color=0A9DF5,strength=2);
width:100%;
}
-->
</style>
<style>
<!--
#glowtext{
filter:glow(color=0A9DF5,strength=2);
width:100%;
}
-->
</style>
<SCRIPT>
<!--
var flyingwin
var popupwidth=200
var popupheight=150
var marginright
var windowcenter
var i_top=200
var i_left=-popupwidth-50
var step=40
var timer
var waitingtime=5000
var pause=20

function showWindow() {
    flyingwin = window.open("", "flyingwin", "toolbar=no,width="+popupwidth+",height="+popupheight+",top=100,left="+(-popupwidth)+"");
    flyingwin.document.open();
    flyingwin.document.write("<html><title>自动离开的窗口</title><body><p align=center>请不要关闭,我马上就自动滚蛋:(</body></html>");
    flyingwin.document.close();
    
    if (document.all) {
        marginright = screen.width+50
    }
    if (document.layers) {
        marginright = screen.width+50
    }
    windowcenter=Math.floor(marginright/2)-Math.floor(popupwidth/2)
    movewindow()
        
}

function movewindow() {
        if (i_left<=windowcenter) {
              flyingwin.moveTo(i_left,i_top)
              i_left+=step
              timer= setTimeout("movewindow()",pause)
        }
        else {
              clearTimeout(timer)
              timer= setTimeout("movewindow2()",waitingtime)
        }
}

function movewindow2() {
        if (i_left<=marginright) {
              flyingwin.moveTo(i_left,i_top)
              i_left+=step
              timer= setTimeout("movewindow2()",pause)
        }
        else {
              clearTimeout(timer)
              flyingwin.close()
        }
}

// -->
</SCRIPT> 

<BODY onload="showWindow();">
<span id="glowtext"><font color="F5D20A" " face="细明体" size="3">热门商品</font></span>

</BODY>
<script language="JavaScript1.2">
function glowit(which){
if (document.all.glowtext[which].filters[0].strength==2)
document.all.glowtext[which].filters[0].strength=1
else
document.all.glowtext[which].filters[0].strength=2
}
function glowit2(which){
if (document.all.glowtext.filters[0].strength==2)
document.all.glowtext.filters[0].strength=1
else
document.all.glowtext.filters[0].strength=2
}
function startglowing(){
if (document.all.glowtext&&glowtext.length){
for (i=0;i<glowtext.length;i++)
eval('setInterval("glowit('+i+')",150)')
}
else if (glowtext)
setInterval("glowit2(0)",150)
}
if (document.all)
startglowing();
</script>

此文章被评分,最近评分记录
财富:10 (by kc715) | 理由: 热心回答会员问题^^


献花 x0 回到顶端 [4 楼] From:台湾亚太线上 | Posted:2005-03-28 17:12 |

首页  发表文章 发表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.022020 second(s),query:16 Gzip disabled
本站由 瀛睿律师事务所 担任常年法律顾问 | 免责声明 | 本网站已依台湾网站内容分级规定处理 | 连络我们 | 访客留言