html5 css js轮播图动画
来源:互联网 发布:王者荣耀输入法软件 编辑:程序博客网 时间:2024/06/05 10:48
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Sundy 日志day11</title>
<style>
#div{
text-align: center;
font-family: Cambria, Hoefler Text, Liberation Serif, Times, Times New Roman, serif;
color: blueviolet;
font-size: 40px;
}
#outer {
width: 651px;
height: 365px;
background: url(Day12-%E5%BE%85%E7%94%A8%E7%A4%BA%E4%BE%8B.html/images/1.jpg) no-repeat;
margin: 100px auto;
border-radius: 40px;
position: relative;
transition: 1s;
}
#inner {
width: 250px;
height: 30px;
position: absolute;
right: 20px;
bottom: 20px;
}
span {
background-color: rgba(200,200,100, 0.5);
width: 30px;
height: 30px;
display: inline-block;
/*行内块,可以设置宽度和高度,且如果可以排开,就在一行*/
border-radius: 15px;
margin-left: 10px;
transition: 1s;
}
span:hover {
cursor: pointer;
background-color: red(255,255,255, 0.5);
transform: scale(1.2);
}
#div1{
background-color: aqua;
border-radius: 20px;
box-shadow:2px 2px 33px #fff;/*设计阴影的*/
font-family: Constantia, Lucida Bright, DejaVu Serif, Georgia, serif;
margin-left: auto;
}
#div2{
margin-top: inherit;
}
</style>
</head>
<body style="background: #056BA3">
<div id="div">
一日学习作业和心得
</div>
<div id="outer">
<div id="inner">
<span onmouseover="changePic(1);" onmouseout="back();"> </span>
<span onmouseover="changePic(2);" onmouseout="back();"> </span>
<span onmouseover="changePic(3);" onmouseout="back();"> </span>
<span onmouseover="changePic(4);" onmouseout="back();"> </span>
<span onmouseover="changePic(5);" onmouseout="back();"> </span>
</div>
</div>
<script>
function changePic(imgNumber) {
document.getElementById("outer").style.backgroundImage = "url(images/" + imgNumber + ".jpg)";
document.getElementById("outer").style.opacity=0.5; //不透明度
//url(images/2.jpg)
}
function back(){
document.getElementById("outer").style.opacity=1;
}
var current=1; //设置当前图片编号
function carousel(){ //轮播
current++;
if(current==6) current=1; //如果到了第5张,加1后变为6,则回到第1张
changePic(current); //改变图片
}
window.setInterval("carousel()",1500); //没个1.5s换一次图片,同时变为半透明
window.setInterval("back()",1600); //每隔1.6s改变为不透明
</script>
<div id="div1">
<h2>读书心得</h2>
<p>读书心得是我们生活中必不少的的程序,书的世界是丰富多彩的,什么都有。</p>
<p>读书让我领悟了人世间的思想和认识,思想:在读书中,我们读的认真,就会感到自己仿佛身临其境</p>
<p>感觉自己是书本里的人物;认识:读书使我们去看世界,了解国内外的事,认识许多有名人物。</p>
<p>所以我们要好好学习,天天向上,让读书丰富我们的知识,开阔我们的视野。</p>
<div id="div2">Sundy
<p>2017.7.25</p></div>
</div>
</body>
</html>
阅读全文
1 0
- html5 css js轮播图动画
- html5+css+js实现动画特效,人物动画
- <html5+css3+js>用javascript显示隐藏,添加,删除元素,css动画效果
- HTML5,CSS,JS知识记录
- html5 css 写九九乘法表加动画
- css动画和js动画比较!
- CSS动画 vs JS动画:谁更快?
- CSS vs JS动画:谁更快?
- 前端CSS&JS动画总结
- 一个JS动画框架-基于HTML5::Canvas
- html5+js+css开发贪吃蛇
- CSS动画实现轮播图
- Spin.js-CSS动画进度加载器
- css动画跳到锚点js代码、小手样式
- css与js动画对比:谁更快?
- CSS vs JS动画:谁更快?---简单笔记
- CSS 和 JS 动画哪个会更快
- css加js动画的几个解决方案
- linux之Vim文档编辑
- LeetCode
- HDU
- 网络编程基础集
- 【Java 你应该知道的】 泛型01
- html5 css js轮播图动画
- Fluent FIDAP v8.7_简体中文教程7.rar
- ASP.net button验证
- String,StringBuffer,StringBuilder的区别
- 编写shell脚本遇到的问题
- (11)XML入门
- include<stdlib.h>与include“kdtree”的本质区别
- spring boot整合ElascticSearch
- python unittest测试框架介绍