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 ...
随机推荐
- JDK NIO SelectionKey bug
此bug项目中使用elasticSearch中出现的,原因是,nio事件选择器,在特性内核下以及jdk6版本中,出现不hold线程,死循环获取事件的bug,导致cup使用率过高: 此bug在官网已被修 ...
- 在colab上运行style-transfer
1, 打开chrome浏览器,输入以下网址,打开风格转换主文件 https://colab.research.google.com/github/Hvass-Labs/TensorFlow-Tuto ...
- COGS 2098. Asm.Def的病毒
★☆ 输入文件:asm_virus.in 输出文件:asm_virus.out 简单对比时间限制:1 s 内存限制:256 MB [题目描述] “这就是我们最新研制的,世界上第一种可持 ...
- liunx中安装软件的几种方式
服务器安装包一般有四种方式 1.源代码包安装 自由度高 需要预编译,安装速度慢 2.rpm包手动安装 安装的缺点是文件的关联性太大 3. 二进制tar.gz格式 直接解压即可 如tomca ...
- 什么是WebSocket (经常听别人讲感觉很高大上其实不然)
WebSocket 协议在2008年诞生,2011年成为国际标准.现在所有浏览器都已经支持了.WebSocket 的最大特点就是,服务器可以主动向客户端推送信息,客户端也可以主动向服务器发送信息,是真 ...
- Bug的分类和管理流程
1.按照严重程度划分 定义:是指Bug对软件质量的破坏程度,即BUG的存在将对软件的功能和性能产生怎样的影响 分类:系统崩溃.严重.一般.次要.建议 2.按优先级划分 定义:表示处理和修正软件缺陷的现 ...
- integer to roman leetcode c++实现
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 t ...
- nvm、npm、nodejs的关系(转载)
nvm.npm.nodejs的关系 为什么要了解nvm.npm.nodejs的关系: reactNative的项目构建都是有这几个工具进行构建管理. 掌握他们的关系,就能了解reactNative项目 ...
- c:if标签--判断不为空和其他的值判断
用<c:if test=""></c:if>标签时 <c:if test="${sl.chc_status==1 }"> ...
- python获取指定文件夹下的文件路径
#!/usr/bin/python# -*- coding: UTF-8 -*-# @date: 2018/1/6 23:08# @name: tmp2# @author:vickey-wu impo ...