js-图片的放大和缩小
来源:互联网 发布:软件过程管理期末试卷 编辑:程序博客网 时间:2024/05/22 02:08
当鼠标点击放大按钮的时候,图片被放大,反之,点击缩小按钮时,图片被缩小
1、行内样式代码的写法:
<!DOCTYPE html>
<head>
<metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/>
<title>无标题文档</title>
<styletype="text/css">
#box{
width:200px;
height:200px;
background-color:#66C;}
</style>
</head>
<body>
<inputtype="button"class="btn1"value="放大"onclick="document.getElementById('box').style.width='400px';document.getElementById('box').style.height='400px';"/>
<inputtype="button"class="btn1"value="缩小"onclick="document.getElementById('box').style.width='100px';document.getElementById('box').style.height='100px';"/>
<divid="box"></div>
</body>
</html>
<!DOCTYPE html>
<head>
<metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/>
<title>无标题文档</title>
<styletype="text/css">
#box{
width:200px;
height:200px;
background-color:#66C;}
</style>
<scripttype="text/javascript">
function tobig(){
document.getElementById('box').style.width='400px';
document.getElementById('box').style.height='400px';
}
function tosmo(){
document.getElementById('box').style.width='100px';
document.getElementById('box').style.height='100px';
}
</script>
</head>
<body>
<inputtype="button"class="btn1"value="放大"onclick="tobig()"/>
<inputtype="button"class="btn1"value="缩小"onclick="tosmo()"/>
<divid="box"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<metacharset="UTF-8">
<title>放大缩小</title>
<styletype="text/css">
body{
padding:50px;
}
.box{
width:200px;
height:200px;
background: red;
}
</style>
<scripttype="text/javascript">
function bianda(){
var ob=document.getElementById('one');
ob.style.width='400px';
ob.style.height='400px';
ob.style.backgroundColor='green';
}
function bianx(){
var ob=document.getElementById('one');
ob.style.width='200px';
ob.style.height='200px';
ob.style.backgroundColor='red';
}
</script>
</head>
<body>
<divclass="box"id="one"onmouseover="bianda()"onmouseout="bianx()"></div>
</body>
</html>
0 0
- js-图片的放大和缩小
- JS实现图片的放大和缩小
- 图片的放大和缩小
- 图片的放大和缩小
- 图片的放大和缩小
- 图片的放大和缩小
- js图片放大缩小
- js图片放大缩小
- 关于图片放大缩小的js
- js滚轮控制图片的放大缩小
- 图片的放大缩小
- 图片的放大缩小
- 图片的放大缩小
- 图片的放大和缩小(不失帧)
- javaScript实现图片的放大和缩小
- js动态放大缩小图片
- js按比例放大缩小图片
- 移动端图片的触屏放大缩小和拖拽事件,touch,js实现的
- PHP中常用的三种设计模式
- 从零开始学_JavaScript_系列(30)——NodeList
- 状态压缩DP 与 树状DP
- Android 定时器使用
- 通过Function Score Query优化Elasticsearch搜索结果
- js-图片的放大和缩小
- 我所了解的计算机
- 《Java 源码分析》:Java NIO 之 Selector(第一部分Selector.open())
- 人生十字路口
- opencv3.0学习之路【10/14】split,merge
- sum
- 20161012 Python 读书笔记之 输出、循环
- 项目实践——语音计算器
- ggplot 的 legend 是一门学问