• 下拉工具栏源码(18808)
    作曲/百科库/2015/04/06 16:54
    <script src="http://www.codefans.net/ajaxjs/jquery-1.6.2.min.js"></script>
    <script>
    var myMessages = ['info','warning','error','success']; // define the messages types
    function hideAllMessages()
    {
    var messagesHeights = new Array(); // this array will store height for each
    for (i=0; i<myMessages.length; i++)
    {
    messagesHeights[i] = $('.' + myMessages[i]).outerHeight();
    $('.' + myMessages[i]).css('top', -messagesHeights[i]); //move element outside viewport
    }
    }
    function showMessage(type)
    {
    $('.'+ type +'-trigger').click(function(){
    hideAllMessages();
    $('.'+type).animate({top:"0"}, 500);
    });
    }
    $(document).ready(function(){
    // Initially, hide them all
    hideAllMessages();
    // Show message
    for(var i=0;i<myMessages.length;i++)
    {
    showMessage(myMessages[i]);
    }
    // When message is clicked, hide it
    $('.message').click(function(){
    $(this).animate({top: -$(this).outerHeight()}, 500);
    });
    });
    </script>
    <style>
    .message{-webkit-background-size: 40px 40px;-moz-background-size: 40px 40px;background-size: 40px 40px;background-image: -webkit-gradient(linear, left top, right bottom,color-stop(.25, rgba(255, 255, 255, .05)), color-stop(.25, transparent),color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .05)),color-stop(.75, rgba(255, 255, 255, .05)), color-stop(.75, transparent),to(transparent));background-image: -webkit-linear-gradient(135deg, rgba(255, 255, 255, .05) 25\%, transparent 25\%,transparent 50\%, rgba(255, 255, 255, .05) 50\%, rgba(255, 255, 255, .05) 75\%,transparent 75\%, transparent);background-image: -moz-linear-gradient(135deg, rgba(255, 255, 255, .05) 25\%, transparent 25\%,transparent 50\%, rgba(255, 255, 255, .05) 50\%, rgba(255, 255, 255, .05) 75\%,transparent 75\%, transparent);background-image: -ms-linear-gradient(135deg, rgba(255, 255, 255, .05) 25\%, transparent 25\%,transparent 50\%, rgba(255, 255, 255, .05) 50\%, rgba(255, 255, 255, .05) 75\%,transparent 75\%, transparent);background-image: -o-linear-gradient(135deg, rgba(255, 255, 255, .05) 25\%, transparent 25\%,transparent 50\%, rgba(255, 255, 255, .05) 50\%, rgba(255, 255, 255, .05) 75\%,transparent 75\%, transparent);background-image: linear-gradient(135deg, rgba(255, 255, 255, .05) 25\%, transparent 25\%,transparent 50\%, rgba(255, 255, 255, .05) 50\%, rgba(255, 255, 255, .05) 75\%,transparent 75\%, transparent);-moz-box-shadow: inset 0 -1px 0 rgba(255,255,255,.4);-webkit-box-shadow: inset 0 -1px 0 rgba(255,255,255,.4);box-shadow: inset 0 -1px 0 rgba(255,255,255,.4);width: 100\%;border: 1px solid;color: #fff;position: fixed;\_position: absolute;text-shadow: 0 1px 0 rgba(0,0,0,.5);-webkit-animation: animate-bg 5s linear infinite;-moz-animation: animate-bg 5s linear infinite;left:0;padding:3px auto;
    }
    /* Download by http://www.codefans.net */
    .info{background-color: #4ea5cd;border-color: #3b8eb5;}
    .error{background-color: #de4343;border-color: #c43d3d;}
    .warning{background-color: #eaaf51;border-color: #d99a36;}
    .success{background-color: #61b832;border-color: #55a12c;}
    .message h4{margin: 0 0 5px 0;font-size:1.5em;
    }
    .message p{margin: 0;}
    @-webkit-keyframes animate-bg{from{background-position: 0 0;}
    to{background-position: -80px 0;}
    }
    @-moz-keyframes animate-bg{from{background-position: 0 0;}
    to{background-position: -80px 0;}
    }
    #trigger-list{text-align: center;padding: 0;}
    #trigger-list li{display: inline-block;*display: inline;zoom: 1;}
    #trigger-list .trigger{display: inline-block;background: #ddd;border: 1px solid #777;padding: 10px;margin: 0;font: bold 12px Arial, Helvetica;text-decoration: none;color: #333;-moz-border-radius: 3px;-webkit-border-radius: 3px;border-radius: 3px;}
    #trigger-list .trigger: hover{background: #f5f5f5;}
    .centered{text-align: center;}
    .twitter-follow-button{position: relative;top: 7px;}
    </style>
    <div class="info message">
    <h4>关于本磨</h4>
    <p>笑忘书网盘 (35230.wodemo.com) 网页代码收藏馆</p>
    </div>
    <div class="error message">
    <h4>下滑的工具条,基于HTML5</h4>
    <p>效果体验如何?留个言说说吧</p>
    </div>
    <div class="warning message">
    <h4>今天天气如何?心情可好?</h4>
    <p>有空到外面走走,晒晒快要发霉的自己</p>
    </div>
    <div class="success message">
    <h4>再见了喔!有空常来</h4>
    <p>保存好本站的书签哦!来了要留言,千万别跑堂</p>
    </div>
    <ul id="trigger-list">
    <li><a href="#" class="trigger info-trigger">关于</a></li>
    <li><a href="#" class="trigger error-trigger">测试</a></li>
    <li><a href="#" class="trigger warning-trigger">测试</a></li>
    <li><a href="#" class="trigger success-trigger">测试</a></li>
    </ul>
操作:该文章你无法操作
【回复列表】
页:
登陆后可以评论小编得文章奥!

返回首页