百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>JS教程> jQuery + CSS实现浪漫表明!(附代码)
分享文章到:

jQuery + CSS实现浪漫表明!(附代码)

发布时间:09/01 来源:未知 浏览: 关键词:
本篇文章给大家介绍一下使用jQuery + CSS实现浪漫表明必备页面。有必然的参照 价值,有需要的伴侣可以参照 一下,但愿对大家有所帮忙。

JQ + CSS实现浪漫表明必备页面

结果图:

图片素材 :

代码如下,复制即可使用:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>浪漫表明 By:阿杜</title>

    <style type = "text/css">
        
        *{
            margin:0px;
            padding:0px;
            }
        html,body{
            height:100%;
            }    
        body{
            font-family:"微软雅黑";        <!-- 此处需要本人修改图片途径 -->
            background:url(images/b1j.jpg) no-repeat fixed;
            background-size:cover;
            
            }    
        .top{
            width:500px;
            height:150px;
            margin:50px auto;
            font-size:30px;
            color:#ea544d;
            }
            
        .box{
            width:310px;
            height:310px;
            margin:0px auto;
            perspective:800px;
            margin-top:-40px;
            }    
        .box .wrap{
            width:210px;
            height:210px;
            position:relative;
            transform-style:preserve-3d;
            animation:play 10s linear infinite;
            }
        .box .wrap ul li{
            list-style:none;
            position:absolute;
            top:0;left:0;
            }    
        @keyframes play{
            from{transform:rotateY(0deg);}
            to{transform:rotateY(360deg);}
            }
            
        .xin,.xin1{
            position:absolute;
            }
            
        .xin{
            animation:xin 8s linear infinite;
            }    
        @keyframes xin{
            0%{top:0%;left:50%;opacity:1;}
            20%{top:20%;left:80%;opacity:0;}
            40%{top:50%;left:50%;opacity:1;}
            60%{top:80%;left:40%;opacity:0;}
            80%{top:50%;left:20%;opacity:1;}
            100%{top:10%;left:0%;opacity:0;}
            }
            .xin1{
            animation:xin 15s linear infinite;
            }
            
        @keyframes xin1{
            0%{top:10%;right:50%;opacity:1;}
            20%{top:50%;right:80%;opacity:0;}
            40%{top:40%;right:50%;opacity:1;}
            60%{top:60%;right:40%;opacity:0;}
            80%{top:50%;right:20%;opacity:1;}
            100%{top:0%;right:0%;opacity:0;}
            }
        .text{
            width:60%;
            margin:0 auto;
            margin-top:-60px;
            font-size:20px;
            line-height:30px;
            font-weight:500;
            animation:color 10s linear infinite;
            }
        @keyframes color{
            0%{color:#039;}
            20%{color:#9C3;}
            40%{color:#6C6;}
            60%{color:#66F;}
            80%{color:#FC9;}
            100%{color:#9FF;}
            }    
                                    
    </style>
    
</head>

<body>
    
    <!--S top-->
    <div class = "top">
        <marquee behavior="alternate">Love Page By:阿杜</marquee>
    </div>
    <!--E top-->
    
    <!--S box-->
    <div class = "box">
        <div class = "wrap">        <!-- 此处需要本人修改图片途径 -->
            <ul>
                <li><img src="images/1.gif" height="210px" width="210px"/></li>
                <li><img src="images/2.gif" height="210px" width="210px"/></li>
                <li><img src="images/3.gif" height="210px" width="210px"/></li>
                <li><img src="images/4.gif" height="210px" width="210px"/></li>
                <li><img src="images/5.gif" height="210px" width="210px"/></li>
                <li><img src="images/6.gif" height="210px" width="210px"/></li>
            </ul>
        </div>
    </div>
    <!--E box -此处需要本人修改图片途径-->
    <div class = "xin">
        <img src="images/xin.png" width="100px" height="100px"/>
    </div>
    
    <div class = "xin1">
        <img src="images/xin.png" width="100px" height="100px"/>
    </div>
    
    <div class = "text">
        <p id = "test"></p>
    </div>    <!-- 此处需要本人修改音频途径 -->
    <embed src="sound/bg.mp3" hidden="true"/>
    <!-- 此处需要本人修改JQ途径 -->
    <script type = "text/javascript" src="js/jquery.min.js"></script>
    
    <script type = "text/javascript">
        
        $(function(){
            
            $(".wrap ul li").each(function(i){
                    var Deg = 360/$(".wrap ul li").size();
                    $(this).css({
                        "transform":"rotateY("+Deg*i+"deg) translateZ(220px)"
                    });
                
                });
            });
            
            window.onload = function autoplay(){
                var b = ['能够碰见你,对我来说是最大的幸福。有了你,我的生活变的无穷宽广,有了你,世界变得如此迷人。你是世界,世界是你。我情愿用本人的心,好好的陪着你,爱着你。陪你到你想去的地方,专心走完我们人生的余下的旅程。在将来的日子里,或许什么都没法肯定,但独一可以肯定的是,我爱的人是你,不管此刻还是未来,我想我这里都会是你最暖和的港湾,都是为你遮风避雨的城墙。不管暴风,不管暴雨。我都会陪在你的身旁,让你不会感到丝毫的担忧和悚惶。我会珍爱和你在一起的每一刻,每一分,每一秒。谁叫你是我最爱的人,谁叫你是第二幸福的人(由于爱上她你是最幸福的了,哈哈)。为了你,我愿用本人的双手为你撑起一片艳阳!'];
                //  分隔字符串
                var str = b.join(""),i=0,arr = str.split('');
                
                var ms_stop = setInterval(function(){
                //  设定主动显现文字
                    if(i>str.length-1){
                        i = 0;
                        document.getElementById('test').innerHTML='';
                        }
                        document.getElementById('test').innerHTML=document.getElementById('test').innerHTML+arr[i];
                        i++;
                    },200);
            }
            
    </script>
</body>
</html>

假如您有更好的点子或更多的功效,可以和我们大家一起分享哦,如有错误,欢迎联络我更正,非常感激!!!

更多炫酷CSS3、html5、javascript、jQuery特效代码,尽在:js特效大全

以上就是jQuery + CSS实现浪漫表明!(附代码)的具体内容,更多请关注百分百源码网其它相关文章!

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有152人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板