网页特效
建站首页
|
广告代码
|
源码下载
|
站长工具
|
字体下载
|
网页模板
|
收藏本站
|
设为首页
网站首页
菜单导航
日期时间
背景图像
图层样式
鼠标键盘
页面窗口
色彩表格
链接文字
表单按钮
计数转换
游戏娱乐
综合实例
特效
热门搜索:
特效代码
js脚本
导航菜单
热点推荐:
英文字体
人民币汇率
dw插件
站长常用软件
alexa排名查询
您的位置:
网页特效
->
色彩表格
-> runtimeStyle Object 网页特效代码
runtimeStyle Object 网页特效代码
作者:runtimeStyle Object 网页特效代码 发布时间:2007-11-19 14:59:07 发布人: admin
<html> <head> <title>runtimeStyle Object</title> <style> BODY {font-size: 8pt; font-family: Arial;} .datahead {font-size: 8pt; font-family: Arial; background-color: #505050; color: #FFFFFF; border: "1 solid"; border-top-color: "#909090"; border-left-color: "#909090"; border-right-color: "#303030"; border-bottom-color: "#303030";} .dataitem {font-size: 8pt; font-family: Arial; background-color: #C0C0C0; color: #000000; border: "1 solid"; border-top-color: "#CFCFCF"; border-left-color: "#CFCFCF"; border-right-color: "#505050"; border-bottom-color: "#505050";} </style> <script> function fnSetData(){ for(var i=1;i<oData.rows.length;i++) { var oWorkRow=oData.rows(i); oWorkRow.cells(1).innerText=eval("oScratch.style." + oWorkRow.cells(0).innerText); oWorkRow.cells(2).innerText=eval("oScratch.runtimeStyle." + oWorkRow.cells(0).innerText); oWorkRow.cells(3).innerText=eval("oScratch.currentStyle." + oWorkRow.cells(0).innerText); } } function fnChangeStyle(oStyle,sValue){ if(sValue.indexOf("CLEAR")>-1){ sValue=""; } eval("oScratch.runtimeStyle." + oStyle + "='" + sValue + "'"); fnSetData(); } function fnInit(){ fnSetData(); } </script> </head> <body onload="fnInit()" topmargin="0" leftmargin="0" bgproperties="FIXED" bgcolor="#FFFFFF" link="#000000" vlink="#808080" alink="#000000"> <h1>runtimeStyle Object Sample</h1> <div id="oScratch" style="border: '5 solid'; border-color: #101010; background-color: #CFCFCF; color: #000000; font-size: 12pt; font-family: 'Arial';"> This sample demonstrates the use of the <b>runtimeStyle</b> object. The <b>runtimeStyle</b> object allows authors to use a particular style to override an existing style specified inline or in a style sheet. In this sample, you can select different values to be set on the <b>runtimeStyle</b> object for the preconfigured properties used for this paragraph. When you select a new value, notice that the values for the <b>runtimeStyle</b> and <b>currentStyle</b> objects change for that property, but the <b>style</b> object does not. When the value is cleared (select 'CLEAR' from the drop-down menu) from the <b>runtimeStyle</b> object, the property value reverts to the <b>style</b> value, and the <b>currentStyle</b> value reflects this. </div> <table id="oData"> <tr> <td class="datahead">CSS Property</td> <td class="datahead">style</td> <td class="datahead">runtimeStyle</td> <td class="datahead">currentStyle</td> <td class="datahead"><b>Select a Value</b></td> </tr> <tr> <td class="dataitem">backgroundColor</td> <td class="dataitem"></td> <td class="dataitem"></td> <td class="dataitem"></td> <td class="dataitem"><select class="dataitem" onchange="fnChangeStyle('backgroundColor',this.options(this.selectedIndex).text)"> <option>Indigo <option>MistyRose <option>MediumOrchid <option>Pink <option>Yellow <option>CLEAR THIS RUNTIME STYLE </select> </td> </tr> <tr> <td class="dataitem">borderColor</td> <td class="dataitem"></td> <td class="dataitem"></td> <td class="dataitem"></td> <td class="dataitem"><select class="dataitem" onchange="fnChangeStyle('borderColor',this.options(this.selectedIndex).text)"> <option>Red <option>Green <option>Blue <option>Yellow <option>CLEAR THIS RUNTIME STYLE </select> </td> </tr> <tr> <td class="dataitem">color</td> <td class="dataitem"></td> <td class="dataitem"></td> <td class="dataitem"></td> <td class="dataitem"><select class="dataitem" onchange="fnChangeStyle('color',this.options(this.selectedIndex).text)"> <option>Red <option>White <option>Blue <option>Yellow <option>Silver <option>Gold <option>CLEAR THIS RUNTIME STYLE </select> </td> </tr> </table> </body> </html> <a href="http://web.archive.org/web/20150530123453/http://myjs.jz123.cn/">欢迎访问阿里西西网页特效集</a>
runtimeStyle Object 网页特效代码
将本文收藏到QQ书签与更多好友分享
上一篇:文章:
表格颜色板网页特效代码
下一篇:文章:
鼠标使链接变色:鼠标放到链接上,每放一次都会出现不同的背景色 网页特效代码
本类浏览排行 »
搜索页面中的内容
又一款综合搜索引擎代码
标题栏显示当前时间
倒影效果的电子表,显示当前时间
自动记录当前页面最新的更新日期
JS让网页每隔2秒弹出一次对话框
一款超酷的CSS列表排行榜
鼠标悬停放大的纯CSS分页效果
本站推荐文章 »
垂直三栏自适应等高布局
仿QQ消息管理器的文本内容样式
支付宝的控制台动画效果菜单
文字、图片拖曳移动
可拉伸移动的DIV层效果
很酷的图片伸缩放大功能
较好的视觉效果的网页选项卡
CSS实例:通过定义渐变边框给图片加阴影