仿时光轴留言特效

css部分:

 <style>
        *{margin:0;padding:0}
        body{font-size:14px;font-family:"微软雅黑";background-attachment:fixed;z-index:0;background-size:100%;}
        .box{width:960px;height:2000px;margin:100px auto;position:relative;z-index:1;}

        /*内容发布区域*/
        .box .boxcenter{width:500px;height:200px;background:#fff;position:absolute;top:80px;left:180px;border:1px solid green;border-radius:6px;}
        .box .boxcenter .boxc_t{height:30px;line-height:30px;}
        .box .boxcenter .boxc_t h4{padding-left:20px;background:#3BBFB4;border-top-left-radius:6px;border-top-right-radius:6px;}
        .box .boxcenter .boxc_c{width:460px;height:100px;border:1px solid #A6C8FF;margin:8px auto;text-indent:10px;box-shadow:0 0 4px #A6C8FF;}
        .box .boxcenter .boxc_b{width:80px;height:30px;position:absolute;right:10px;bottom:8px;}
        .box .boxcenter .boxc_b a{font-size:14px;color:#fff;line-height:30px;background:#3bbfb4;border-radius:6px;display:block;text-align:center;text-decoration:none;}
        .box .boxcenter .boxc_b a:hover{background:#2C8E86;}
        .box .timeline{width:60px;height:100%;position:absolute;top:100px;left:80px;border-right:2px solid #5d7895;}/**/
        .timeline .timeline_t{width:50px;height:50px;border-radius:50%;border:1px solid #fff;background-size:100%;}
        .timeline .nextbox{width:380px;height:80px;position:absolute;top:260px;left:60px;}
        .a{width:380px;height:80px;background:#fff;border-radius:6px;margin-top:30px;font-size:16px;line-height:20px;text-indent:20px;word-break:break-all;position:relative;left:6px;}
        .a .b{width:6px;height:6px;border-radius:50%;border:2px solid #fff;background:#9DCFE1;position:absolute;top:35px;left:-10px;}
        #time{font-size:20px;color:#ababab;}
        #hour{font-size:12px;color:#92CADE;}
    </style>

html部分:

<div class="box">

    <!--内容发布区域-->
    <div class="boxcenter">
        <div class="boxc_t"><h4>随便说点什么吧...</h4></div>
        <div class="boxc_c" contenteditable="true" id="aa"></div>
        <div class="boxc_b"><a href="#">发布</a></div>
    </div>

    <!--时光轴线-->
    <div class="timeline">
        <div class="timeline_t">
        </div>
        <div class="nextbox"></div>
    </div>

</div>

js部分:(此处需要引入jquery.js)

<script type="text/javascript">
    $(function(){
        $(".box").find(".boxc_b").click(function(){
            var center = $(".boxc_c").text();//.appendTo("nextbox");
            if(center==""){
                alert("请输入内容喔!");
                return;
            }
            $(".nextbox").prepend("<div class=‘a‘>"+
                    "<div class=‘b‘></div>"+
                    "<span id=‘time‘>"+year+"-"+
                    month+"-"+
                    day+"&nbsp;&nbsp;"+
                    "<span id=‘hour‘>"+hour+":"+min+"</span>"+
                    "</span>"+
                    "<br>"+
                    "<p style=‘padding:4px‘>"+center+"</p>"+
                    "</div>");
            $(".boxc_c").text("");
        });
        //alert(1);
        $(".boxc_c").keydown(function(event){
            var len =$(".boxc_c").text().length;
            if(len > 70){
                alert("够了,你别输入了,哪儿那么多话儿!");
            }
        });

        var dateDom = new Date();
        //获取本地时间,年月日时分
        var year = dateDom.getFullYear();
        var month = dateDom.getMonth()+1;
        var day = dateDom.getDate();
        var hour = dateDom.getHours();
        var min = dateDom.getMinutes();
    });
</script>
时间: 2024-08-10 00:05:42

仿时光轴留言特效的相关文章

Ajax+JQuery留言特效

原文:Ajax+JQuery留言特效 源代码下载地址:Ajax+JQuery留言特效

仿github404页面特效

阅读原文 ??偶然看到github的404页面,没想到github的404页面也是做的很有心,就试着找了下源码,打算仿一下这个效果. ??这个效果看上去是3d的,其实没有用到css3里边的任何一个与3d有关的属性,这个页面应该在很早之前就被做出来了,可能那时的css3兼容性还没现在这么好.这个页面是借用图片错位,以及图片运动速度不一致,给人一种立体感.下边先看下html结构: <div id="wrapper"> <div id="field"&g

腾讯QQ空间穿越时光轴3D特效

<DOCTYPE html> <html> <head> <title>腾讯QQ空间穿越光轴3D特效</title> <style> *{margin:0;padding:0;} body{ background-image:url("images/bg.png") fixed;//拖动鼠标图片不会上下移动 height:2000px; } .con{ width:1000px; /*heigth:500px;*/

Qt仿Android带特效的数字时钟源码分析(滑动,翻页,旋转效果)

这个数字时钟的源码可以在Qt Demo中找到,风格是仿Android的,不过该Demo中含有三种动画效果(鉴于本人未曾用过Android的系统,因此不知道Android的数字时钟是否也含有这三种效果),其分别为滑动.翻页和旋转. 由于本人的Qt Creator输入中文后显示的都是乱码,因而在此只能使用英文进行注释,后期如果有时间再进行中文的相关整理.可能有些地方理解并不是很正确.希望大家多多指正! 以下为源码: [cpp] view plaincopy #include <QtCore> #i

WPF制作QQ列表(仿qq列表特效)

先看效果图:这个是折叠特效. 代码结构:      model是我们的数据模型,定义了在列表显示的人物名称   图片   简介    . Resource是我们的图片资源  和 存储图片资源路径.名称的资源文件. GroupListCreate是我们的主要创建列表的模块. 代码如下: public StackPanel CreateModuleEntry(List<GroupPerson> hrvGroups) { if (hrvGroups != null) { StackPanel spl

javascript 仿百度穿墙特效

原理是判断从上下左右哪个方向移入遮罩层从哪个方向运动进入,从哪个方向移出,遮罩层从哪个方向运动滑出. 这个是圆的角度弧度转换公式: 角度->弧度n*PI/180; 弧度->角度n*180/PI; 角度->方向Math.atan2(y,x) 上js代码 function a2d(a){ return a*180/Math.PI; }//判断移入的方向 function hoverDir(obj,oEvent){ var x = obj.offsetLeft+obj.offsetWidth/

精仿win8风格简约迷你风格扁平化html5网站模版

这是缩略图 模版采用html5设计,仿win8菜单特效,扁平化处理 下载地址:精仿win8风格网站模版 精仿win8风格简约迷你风格扁平化html5网站模版,布布扣,bubuko.com

仿win8磁贴界面以及功能

做移动产品界面占很大的一部分,同时也是决定一款产品好的的重要因素,最近看见有人放win8的界面效果,搜了两款,一款是只是仿界面没有特效,另一款是自定义组件能够实现反转效果,今天分析一下这两类界面. 仿win8界面 win8磁贴类似九宫格效果,实现这种效果基本上有三种方式实现:LinearLayout,使用其属性layout_weight实现等分:TableLayout,做过计算器的人可能会用到过这个,也可以实现,还有一种就是GridView,自己实现适配器,我找到的仿win8界面使用Linear

你好,迟到的2016

大三下学期开始自学的前端,断断续续半年多,开始找前端相关的工作:到现在,走过了毕业期的十字路口,已经工作一年了:好吧,严重掉底子了,我是个比较懒的人...既然起步较晚,那么就只有马不停蹄的追赶了,奔跑吧,小前端! 写这个2015的年终总结,没什么经验之谈,只是继往开来,反省反省:继续追逐大神们的脚步,偶尔站在巨人的肩膀上眺望下未来! 一.原谅我,Jquery: 工作之前,那时什么基础都没有,只是逼于即将毕业后的压力,百度到了前端开发,就直接从原生JS开始学了:学不动了,问了下认识的计算机系的学长