Jquery 實現許願牆效果,可拖拽

來源:互聯網
上載者:User

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

先簡單的介紹下功能點:

  • 隨機顯示背景圖或背景色
  • 出現的位置隨機
  • 可以通過拖拽改變位置
<!doctype html><html lang="en"><head>    <meta charset="UTF-8"/>    <title>許願牆</title>    <link rel="stylesheet" href="base.min.css"/>    <style>    #wish{height:650px;margin:20px;position:relative;width:960px;}    .wish{background:url(wish_bg.png) no-repeat 0 0;color:#000;height:166px;padding:10px 20px 30px 20px;width:185px;}    .wish-close{background:url(wish_close_bg.png) no-repeat 0 0;display:none;position:absolute;right:5px;top:-5px;width:17px;height:17px;}    .s1 { background: url(s1.png); }    .s2 { background: url(s2.png); }    .s3 { background: url(s3.png); }    .s4 { background: url(s4.png); }    .s5 { background: url(s5.png); }    </style></head><body>    <ul id="wish">        <li>11111</li>        <li>22222</li>        <li>33333</li>        <li>44444</li>        <li>55555</li>    </ul></body></html><script src="jquery.min.js"></script><script src="jquery-ui.min.js"></script><script src="wish.js"></script><script>$(function(){    $(‘#wish‘).wish();    $(‘.wish‘).draggable({containment:‘#wish‘,scroll:false});});</script>

注意:

jqueryui 需要載入 draggable 和 scale Effect,draggable 是支援拖拽,而 scale Effect 是點擊關閉的效果。

點此此處下載檔案

Jquery 實現許願牆效果,可拖拽

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.