Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图片逐个自动显示 #35

Open
lcgyh opened this issue Dec 13, 2017 · 2 comments
Open

图片逐个自动显示 #35

lcgyh opened this issue Dec 13, 2017 · 2 comments

Comments

@lcgyh
Copy link
Owner

lcgyh commented Dec 13, 2017

No description provided.

@lcgyh lcgyh added the 主题 label Dec 13, 2017
@lcgyh lcgyh closed this as completed Dec 13, 2017
@lcgyh lcgyh reopened this Aug 29, 2018
@lcgyh
Copy link
Owner Author

lcgyh commented Aug 2, 2019

图片逐个自动顺序显示

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="http://r01.uzaicdn.com/content/v1/styles/subject.css"> 
    <link rel="stylesheet" href="styles/lianxi.css">
    <script src="http://r01.uzaicdn.com/content/v1/scripts/core.js"></script>
    <script src="scripts/lianxi.js"></script>
    <!--[if lt IE 9]><script src="//r.uzaicdn.com/content/libs/html5shiv.js"></script><![endif]-->
    <!--[if IE 6]><script src="//r.uzaicdn.com/content/libs/dd_belatedpng_0.0.8a-min.js" type="text/javascript"></script><script>DD_belatedPNG.fix('.png');</script><![endif]-->
    <style type='text/css'>
        .carousel{width: 780px;margin: 0 auto;}
        .carousel .item{width: 220px;float: left;margin:0 20px;background: pink;}
        .carousel .item img{width: 100%;opacity: 0;}
        .carousel .item img:hover{opacity: 1;}
        .carousel .on img{opacity: 1;}
    </style>
</head>
<body>
  <ul class="clearfix carousel" id="j_carousel">
    <li class="item"><img src="http://i1.hexunimg.cn/2014-08-15/167580248.jpg" alt=""></li>
    <li class="item"><img src="http://r06.uzaicdn.com/temaihuiimages/20161012/4509688d886f48e1be47b63c9ef505c4.jpg?imageView2/2/w/280/h/210" alt=""></li>
    <li class="item"><img src="http://r05.uzaicdn.com/temaihuiimages/p2923/48b153e54354461e8aa5c4b214600f9e.png?imageView2/2/w/280/h/210" alt=""></li>
  </ul>
</body>
<script>
    $(function(){
    function axGallery(){
       var items=$('#j_carousel .item');
       var iLen=items.length;
       var i=0; 
setInterval(function(){
    if(i>=iLen){
        i=0;
    }
    items.removeClass('on').eq(i).addClass('on');
    i++;
},2000);
}
 axGallery();
})

</script>
</html>

@lcgyh lcgyh changed the title node.js 图片逐个自动顺序显示 Aug 2, 2019
@lcgyh
Copy link
Owner Author

lcgyh commented Aug 2, 2019

图片逐个自动随机显示

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="http://r01.uzaicdn.com/content/v1/styles/subject.css"> 
    <link rel="stylesheet" href="styles/lianxi.css">
    <script src="http://r01.uzaicdn.com/content/v1/scripts/core.js"></script>
    <script src="scripts/lianxi.js"></script>
    <!--[if lt IE 9]><script src="//r.uzaicdn.com/content/libs/html5shiv.js"></script><![endif]-->
    <!--[if IE 6]><script src="//r.uzaicdn.com/content/libs/dd_belatedpng_0.0.8a-min.js" type="text/javascript"></script><script>DD_belatedPNG.fix('.png');</script><![endif]-->
    <style type='text/css'>
        .carousel{width: 780px;margin: 0 auto;}
        .carousel .item{width: 220px;float: left;margin:0 20px;background: pink;}
        .carousel .item img{width: 100%;opacity: 0;}
        .carousel .item img:hover{opacity: 1;}
        .carousel .on img{opacity: 1;}
    </style>
</head>
<body>
  <ul class="clearfix carousel" id="j_carousel">
    <li class="item"><img src="http://r06.uzaicdn.com/temaihuiimages/20161012/4509688d886f48e1be47b63c9ef505c4.jpg?imageView2/2/w/280/h/210" alt=""></li>
    <li class="item"><img src="http://r05.uzaicdn.com/temaihuiimages/p2923/48b153e54354461e8aa5c4b214600f9e.png?imageView2/2/w/280/h/210" alt=""></li>
    <li class="item"><img src="http://i1.hexunimg.cn/2014-08-15/167580248.jpg" alt=""></li>
  </ul>
</body>
<script>
    $(function(){
    function axGallery(){
       var items=$('#j_carousel .item');
       var iLen=items.length;
       var i=0; 
setInterval(function(){
    i=parseInt(Math.random()*iLen,10);
    items.removeClass('on').eq(i).addClass('on');
},1000);
}
 axGallery();
})

</script>
</html>

@lcgyh lcgyh changed the title 图片逐个自动顺序显示 图片逐个自动显示 Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant