3秒一换轮播(鼠标选中旋转停止定时) 动画案例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>广告轮播</title>
    <script type="text/javascript" src="tzy.js" language="JavaScript"></script>
    <link rel="stylesheet" href="tzy.css" type="text/css">
</head>
<body onload="lunbozantin()">
<div>
    <p><b>我是轮播图片</b></p>
    <img src="1.jpg" alt="lol图片" id="tupian" onMouseOver="stoplunbo()" onMouseOut="lunbozantin()">
</div>
</body>
</html>
*{
    margin:0px;
    padding:0px;
}
div{
    width: 508px;
    height: 330px;
    margin: 100px auto;
    padding: 5px;
    background-color: coral;
}
p{
    width: 528px;
    height: 30px;
    text-align: center;
    font-family: "楷体";
    line-height: 30px;
    font-size: 25px;
}
img{
    width: auto;
    height: auto;
    background-color: deepskyblue;
    -webkit-transition: width 1s, height 1s, -webkit-transform 1s;
    /*暂定高宽无变化自动,有变化则为1秒*/
    transition: width 1s, height 1s, transform 1s;
}
img:hover{
    width: auto;
    height: auto;
    transform:rotate(360deg);
    -webkit-transform:rotate(360deg);
}
var arr = new Array("1.jpg","2.jpg","3.jpg","4.jpg");
var count = 1;
var b;
function lunbo() {
    a = document.getElementById("tupian");
    a.src =arr[count];
    count++;
    if(count==4){
        count=0;
    }
}
function stoplunbo(){
    clearInterval(b);
}function lunbozantin() {
    b = setInterval(lunbo,3000);
}
时间: 2024-08-01 22:36:59

3秒一换轮播(鼠标选中旋转停止定时) 动画案例的相关文章

HTML 3秒一换轮播(鼠标选中旋转停止定时) 动画案例

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>广告轮播</title> <script type="text/javascript" src="tzy.js" language="JavaScript"></script>

bootstrap 轮播 鼠标移入 移出 最终

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

bootstrap 轮播 鼠标移入 移出

<!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-

模仿东京首页banner轮播,京东新闻上下滚动动画实现(动画实现)

接着上篇 微信小程序-阅读小程序demo写:http://www.cnblogs.com/muyixiaoguang/p/5917986.html 首页banner动画实现 京东新闻上下动画实现 想着模仿京东首页呢,结果也没赶得及写完,轮播图让我搞了好长时间.也好,那就国庆8天好好的写一下,这里写了一半,先放着.先介绍一下这一半的内容.       还是老规矩,先放个图吧,虽然才一点点了 上线的banner大图和京东头条都是可以滚动的,抄写微信小程序社区官方qq群:390289365里 Nige

关于图片轮播图的一个简单实例 以及实例中发现问题

1.最近在学习JS的过程中,为了巩固水平做了一个简单的轮播图,以及在做的过程中发现一些问题(未解决!希望可以有大佬可以解释这个问题)2.代码如下:<!DOCTYPE html><html><head lang="en"><meta charset="UTF-8"><title></title><style>*{margin: 0;padding: 0;}.wai{width: 100

原生js实现移动端Touch轮播图的方法步骤

Touch 轮播图 touch轮播图其实就是通过手指的滑动,来左右切换轮播图,下面我们通过一个案例,来实现下. 1. html 结构 结构上,还是用ul.li来存放轮播图片,ol.li来存放轮播小圆点: 2. 样式初始化 html的一些标签,都会有一些默认样式,比如body标签默认是有一个边距的,为了不影响美观,我们需要清除掉. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 /* 清除标签默认边距 */ body,ul,li,ol,im

JavaScript实战项目:移动端 Touch 轮播图

Touch 轮播图 touch轮播图其实就是通过手指的滑动,来左右切换轮播图,下面我们通过一个案例,来实现下. 1. html 结构 结构上,还是用ul.li来存放轮播图片,ol.li来存放轮播小圆点: 2. 样式初始化 html的一些标签,都会有一些默认样式,比如body标签默认是有一个边距的,为了不影响美观,我们需要清除掉. /* 清除标签默认边距 */ body,ul,li,ol,img { margin: 0; padding: 0; } /* 清除 ul 等标签前面的"小圆点"

教你如何实现 Android TextView 文字轮播效果

效果图: 实现思路: 1.ViewAnimator 思路 使用 ViewAnimator 自身特性,对期中的子 view 实现动画切换 2.自定义 viewGroup 思路 在这个思路下,我们自定义一个容器,继承 FrameLayout ,根据数据数量自己 new 相应数量的 itemView 出来加入 FrameLayout ,动画是通过对当前 itemView 做一个出去的佛纳甘话,同时对下一个 itemView 做一个进入动画,使用 handle 实现延迟轮换 3.ViewFlipper

iOS-图片轮播-SDCycleSCrollView的使用

介绍: SDCycleScrollView 是一款非常强大的轮播图第三方. 轮播流畅,手滑流畅.使用方便.自定义简单. 可以更改pageControl. 一. Demo地址 https://pan.baidu.com/disk/home#list/path=%2F总结%2FDemo-图片轮播 二.效果截图. 三.代码. #import "ViewController.h" #import "Masonry.h" #import "SDCycleScroll