一款基於jquery ui漂亮的可拖動div執行個體

來源:互聯網
上載者:User

標籤:style   blog   http   color   io   os   ar   sp   div   

今天要給大家帶來一款基於jquery ui漂亮的可拖動div執行個體。這款執行個體用了圖片當背景,div層採用了幽靈透明效果。div拖動是基於jquery ui的。介面非常漂亮。一起看下:

線上預覽   源碼下載

實現的代碼。

html代碼:

    <div id="box1" class="box blurred-bg tinted">        <h1>            Blurred Background</h1>        <h2>            By <a href="http://www.w2bc.com">Ariona, Rian</a></h2>        <p>            Drag this box to move around</p>    </div>

css代碼:

 body        {            background-image: url("normal.jpg");            background-repeat: no-repeat;            background-size: cover;            background-attachment: fixed;            font-family: Raleway, Open Sans, Droid Sans, Roboto,arial, sans-serif;        }                .blurred-bg        {            background-image: url("blur.jpg");            background-repeat: no-repeat;            -moz-background-size: cover;            -o-background-size: cover;            -webkit-background-size: cover;            background-size: cover;            background-attachment: fixed;        }        .blurred-bg.tinted        {            background-image: -moz-linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)), url("blur.jpg");            background-image: -webkit-linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)), url("blur.jpg");            background-image: linear-gradient(0deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)), url("https://lh3.googleusercontent.com/-m8TxQMObg6c/U474EWu7Y9I/AAAAAAAAI2k/xkRGoIEC1iU/s1600/blur.jpg");        }        .blurred-bg.shaded        {            background-image: -moz-linear-gradient(90deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url("blur.jpg");            background-image: -webkit-linear-gradient(90deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url("blur.jpg");            background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url("blur.jpg");        }                .box        {            width: 500px;            height: 300px;            left: -webkit-calc( 50% - 250px );            top: 20%;            position: absolute;            border-radius: 5px;            -moz-box-shadow: 0 20px 30px rgba(0, 0, 0, 0.6);            -webkit-box-shadow: 0 20px 30px rgba(0, 0, 0, 0.6);            box-shadow: 0 20px 30px rgba(0, 0, 0, 0.6);            border: 1px solid rgba(255, 255, 255, 0.3);            padding: 20px;            text-align: center;            -moz-box-sizing: border-box;            -webkit-box-sizing: border-box;            box-sizing: border-box;            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);        }        .box:active        {            cursor: move;        }                h1, h2, a, p        {            color: white;            font-weight: 100;        }        .tinted h1, .tinted h2, .tinted a, .tinted p        {            color: black;            text-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);        }                h2        {            font-size: 14px;        }                p        {            margin: 20px;        }

註:本文愛編程原創文章,轉載請註明原文地址:http://www.w2bc.com/Article/8713

一款基於jquery ui漂亮的可拖動div執行個體

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.