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 ...
随机推荐
- Java-学完一个月总结(javaSe学习路线)
JavaSe的一个月 第一周 0410 基本数据类型:数据类型的转换:运算符:导入删除项目0411 分支结构if else:switch case ;while0412 do while ;for / ...
- CF778B(round 402 div.2 E) Bitwise Formula
题意: Bob recently read about bitwise operations used in computers: AND, OR and XOR. He have studied t ...
- KendoUI Grid Pager部分 Nan-Nan of x Items
相关问题: http://stackoverflow.com/questions/23941065/pager-error-in-kendo-gridnan-nan-of-1-items http:/ ...
- java大文件读写操作,java nio 之MappedByteBuffer,高效文件/内存映射
java处理大文件,一般用BufferedReader,BufferedInputStream这类带缓冲的Io类,不过如果文件超大的话,更快的方式是采用MappedByteBuffer. Mapped ...
- codevs 6116 区间素数
时间限制: 8 s 空间限制: 256000 KB 题目等级 : 白银 Silver 题解 题目描述 Description 小明喜欢研究素数,他想统计两个自然数之间的素数个数,现在 ...
- 螺旋数字的python实现
螺旋数字的算法简单实现. 示例 5 01 02 03 04 05 16 17 18 19 06 15 24 25 20 07 14 23 22 21 08 13 12 11 10 09 通过观察,外部 ...
- 骑芯供应链(T 面试)
1.目前市面上主流的团队开发模式是什么? 正解:DevOps,https://blog.csdn.net/bntX2jSQfEHy7/article/details/79168865 2.你觉得什么是 ...
- 判断请求是否为ajax
判断请求是否为ajax 转载:http://www.cnblogs.com/tony-jingzhou/archive/2012/07/30/2615612.html x-requested-with ...
- JDK 5 ~ 11 新特性倾情整理
为了大家对JDK有一个全面的了解,下面我为大家整理了JDK5~11的所有关键新特性! 先看一下JDK的版本迭代图: 注: OpenJDK和JDK区别 GPL协议通用性公开许可证(General ...
- QTreeWidgetItem封装
#include "qtreewighthelper.h" QTreeWidgetItem* AddQTreeWidgetItemChild(QTreeWidgetItem* pa ...