js82:CSS的Style,image的重定位,getElementById,getElementsByTagName,location.href
原文发布时间为:2008-11-10 —— 来源于本人的百度文章 [由搬家工具导入]
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>js</title>
<style>
.level1 {
font-style: normal;
font-weight: bold;
font-variant: normal;
color: #00FF99;
background-color: #FF0000;
text-decoration: underline;
}
</style>
<script type="text/javascript">
function csschange(){
var c1=document.getElementById("p1");
c1.style.fontStyle="italic";
c1.style.fontWeight="normal";
c1.style.fontVariant="normal";
c1.style.color="blue";
c1.style.backgroundColor="green";
c1.style.textDecoration="blink";
}
function bytag(){
var c2=document.getElementsByTagName("p");
c2[0].style.fontStyle="italic";
c2[0].style.fontWeight="normal";
c2[0].style.fontVariant="normal";
c2[0].style.color="red";
c2[0].style.backgroundColor="yellow";
c2[0].style.textDecoration="blink";
c2[1].style.backgroundColor="yellow";
}
var position=new Array();
position[0]=200;position[1]=150;
position[2]=300;position[3]=150;
position[4]=300;position[5]=300;
position[6]=200;position[7]=300;
var i=0;
function run(){
var m=document.getElementById("move");
m.style.left=position[i];
m.style.top=position[i+1];
i+=2;
if(i==8)
i=0;
}
function checkbrowser(){
if(!document.getElementById)
alert('浏览器不支持此程序');
else if(!document.all){
alert('浏览器不支持此程序');
document.location.href="http://www.baidu.com";
}
}
</script>
</head>
<body onload="checkbrowser();runing=setInterval('run();',100);">
<p class="level1" id="p1">改变你</p>
<p> </p>
<form id="form1" name="form1" method="post" action="">
<label>
<input name="change" type="button" id="change" value="按钮ByID" onclick="csschange();" />
</label>
<label>
<input name="tag1" type="button" id="tag1" value="按钮ByTag" onclick="bytag();" />
</label>
</form>
<span style="position:absolute;left:200px;top:300px;" id="move">
<img src="../../图片/视觉/image016.jpg" width="100" height="100"/>
</span>
<input name="Stop" type="button" id="stop" onclick="clearInterval(runing);" value="Stop" />
</body>
</html>
1、JavaScript引用Css属性时,若有连接符,须去掉连接符,并把连接符后面的单词的第一个字符大写,如css属性background-color,引用时需写成backgroundColor。
2、getElementsByTagName是数组,getElementById是唯一一个
3、JavaScript引用属性时一般是document.getElementById("objectId").style.属性
4、用if(!document.getElementById)可以判断该浏览器是不是W3C标准,用 else if(!document.all)可以判断是不是旧版本的IE浏览器
js82:CSS的Style,image的重定位,getElementById,getElementsByTagName,location.href的更多相关文章
- Html CSS学习(五)position定位 原
Html CSS学习(五)position定位 position用来对元素进行定位,其值有以下几种: static:无特殊定位,对象遵循正常文档流,top,right,bottom,left等属性不会 ...
- 一款多功能的移动端滚动选择器,支持单选到多选、支持多级级联、提供自定义回调函数、提供update函数二次渲染、重定位函数、兼容pc端拖拽等等..
https://github.com/onlyhom/mobileSelect.js/blob/master/docs/README-CN.md mobileSelect.js 一款多功能的移动端滚动 ...
- 鸿蒙内核源码分析(重定位篇) | 与国际接轨的对外部发言人 | 百篇博客分析OpenHarmony源码 | v55.01
百篇博客系列篇.本篇为: v55.xx 鸿蒙内核源码分析(重定位篇) | 与国际接轨的对外部发言人 | 51.c.h.o 加载运行相关篇为: v51.xx 鸿蒙内核源码分析(ELF格式篇) | 应用程 ...
- Reverse Core 第二部分 - 16&17章 - 基址重定位表&.reloc节区
第16-17章 - 基址重定位表&.reloc节区 @date: 2016/11/31 @author: dlive 0x00 前言 这几天忙着挖邮箱漏洞,吃火锅,马上要被关禁闭,看书进度比较 ...
- IOAPIC重定位中断处理函数思路整理
因为小可并非硬件编程出身,汇编基础又比较差...所以刚开始理解利用IOAPIC重定位技术的时候相当困难. 何为IOAPIC? 首先,必须认识到它是一个硬件,可编程的硬件.我理解的它在整个流程中的作用如 ...
- ELF Format 笔记(十)—— 重定位(relocation)
ilocker:关注 Android 安全(新手) QQ: 2597294287 重定位就是把符号引用与符号定义链接起来的过程,这也是 android linker 的主要工作之一. 当程序中调用一个 ...
- [PE结构分析] 10.基址重定位
源代码如下: typedef struct _IMAGE_BASE_RELOCATION { DWORD VirtualAddress; DWORD SizeOfBlock; // WORD Type ...
- 小甲鱼PE详解之基址重定位详解(PE详解10)
今天有一个朋友发短消息问我说“老师,为什么PE的格式要讲的这么这么细,这可不是一般的系哦”.其实之所以将PE结构放在解密系列继基础篇之后讲并且尽可能细致的讲,不是因为小甲鱼没事找事做,主要原因是因为P ...
- [CSAPP-II] 链接[符号解析和重定位] 静态链接 动态链接 动态链接接口
1 平台 转http://blog.csdn.net/misskissc/article/details/43063419 1.1 硬件 Table 1. 硬件(lscpu) Architecture ...
随机推荐
- 洛谷P2774 方格取数问题(最小割)
题意 $n \times m$的矩阵,不能取相邻的元素,问最大能取多少 Sol 首先补集转化一下:最大权值 = sum - 使图不连通的最小权值 进行黑白染色 从S向黑点连权值为点权的边 从白点向T连 ...
- 【HEVC帧间预测论文】P1.6 A Fast HEVC Inter CU Selection Method Based on Pyramid Motion Divergence
A Fast HEVC Inter CU Selection Method Based on Pyramid Motion Divergence <HEVC标准介绍.HEVC帧间预测论文笔记&g ...
- qt5.8使用qwebenginview注意事项
环境qt5.8,vs2015(ui.webview必须要先show出来,不然加载不成功) 1.项目属性,c/c++,常规,附加包含目录,新增: $(QTDIR)\include\QtWebChanne ...
- MVC之在实例中的应用
MVC模式在Java Web应用程序中的实例分析 1. 结合六个基本质量属性 1)可用性 2)可修改性 3)性能 4)安全性 5)可测试性 6)易用性 2. 分析具体功能模块的MVC设计实现(例如登录 ...
- app支付宝授权登录获取用户信息
由后台进行地址的拼接(前台进行授权) // 生成授权的参数 String sign = ""; Long userId1 = SecurityUser.getUserId(); S ...
- Docker 启动时报错:iptables:No chain/target/match by the name
重新启动docker后,就好了. service docker restart
- 【整理】iview中刷新页面的时候更新导航菜单的active-name
iview中刷新页面的时候更新导航菜单的active-name https://blog.csdn.net/lhjuejiang/article/details/83212070
- MFC不同分辨率和缩放下正常显示的方法
方法1:为了满足Windows操作系统上不同分辨率下的显示,我们在OnPaint中重绘.
- Java中Synchronized和Lock的使用
Lock的锁定是通过代码实现的,而 synchronized 是在 JVM 层面上实现的 synchronized在锁定时如果方法块抛出异常,JVM 会自动将锁释放掉,不会因为出了异常没有释放锁造成线 ...
- github下拉刷新与上拉加载地址
https://github.com/chrisbanes/Android-PullToRefresh