国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 語(yǔ)言 > JavaScript > 正文

Jquery仿IGoogle實(shí)現(xiàn)可拖動(dòng)窗口示例代碼

2024-05-06 16:07:56
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
這個(gè)拖動(dòng)窗口是根據(jù)一個(gè)Jquery的框架直接做出來(lái)的:easywidgets,廢話就不多說(shuō)了,直接把源代碼貼出來(lái),讓大家學(xué)習(xí)
 
 

google可謂是ajax的特效用的淋漓盡致,google suggest, google map,igoogle 可拖動(dòng)窗口等等...今天要做一個(gè)網(wǎng)站的類(lèi)似效果,仿照iGoogle做了一個(gè)簡(jiǎn)單的小demo。

這個(gè)的demo是根據(jù)一個(gè)Jquery的框架直接做出來(lái)的:easywidgets。這個(gè)框架是可以免費(fèi)下載的http://plugins.jquery.com/project/easywidgets。

廢話就不多說(shuō)了,直接把源代碼貼出來(lái),讓大家學(xué)習(xí)!
html

<html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" type="text/css" media="screen" href="css/my.css" rel="external nofollow" rel="external nofollow" mce_href="css/my.css" rel="external nofollow" rel="external nofollow" /><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/jquery-ui.min.js"></script><script type="text/javascript" src="js/jquery.easywidgets.js"></script> <script src="js/example.js" type="text/javascript"></script></head><body><!--left--><div id="left" class="widget-place column1"><div id="ldiv1" class="widget movable"><div id="header" class="widget-header"><strong>drar me</strong> </div><div id="content" class="widget-content">左邊-----用鼠標(biāo)拖動(dòng)</div> </div><div id="ldiv2" class="widget movable"><div id="header" class="widget-header"><strong>drar me</strong> </div><div id="content" class="widget-content">左邊-----用鼠標(biāo)拖動(dòng)</div></div><div id="ldiv3" class="widget movable"><div id="header" class="widget-header"><strong>drar me</strong> </div><div id="content" class="widget-content">左邊-----用鼠標(biāo)拖動(dòng)</div></div></div><!--middle--><div id="middle" class="widget-place column2"> <div id="mdiv1" class="widget movable collapsable removable editable"><div id="header" class="widget-header"><strong>drar me</strong> </div><div class="widget-editbox" style="background:#CC6699" mce_style="background:#CC6699">這里就是放編輯的內(nèi)容,為了顯眼,我加了背景</div><div id="content" class="widget-content">中間------用鼠標(biāo)拖動(dòng)</div></div><div id="mdiv2" class="widget movable removable editable"><div id="header" class="widget-header"><strong>drar me</strong> </div><div id="content" class="widget-content">中間------用鼠標(biāo)拖動(dòng)</div></div><div id="mdiv3" class="widget movable removable editable"><div id="header" class="widget-header"><strong>drar me</strong> </div><div id="content" class="widget-content">中間------用鼠標(biāo)拖動(dòng)</div></div></div><!--right--><div id="right" class="widget-place column3"><div id="rdiv1" class="widget movable"> <div id="header" class="widget-header"><strong>drar me</strong> </div><div id="content" class="widget-content">右邊------用鼠標(biāo)拖動(dòng)</div></div><div id="rdiv2" class="widget movable"><div id="header" class="widget-header"><strong>drar me</strong> </div><div id="content" class="widget-content">右邊------用鼠標(biāo)拖動(dòng)</div></div><div id="rdiv3" class="widget movable"><div id="header" class="widget-header"><strong>drar me</strong> </div><div id="content" class="widget-content">右邊------用鼠標(biāo)拖動(dòng)</div></div></div></body></html>

CSS

body{margin: 0;padding: 0;background-color: silver;font-family: 'Lucida Grande','Lucida Sans Unicode','宋體','新宋體',arial,verdana,sans-serif; color: #666; font-size:20px; line-height:150%; }#left{width: 380px;height: 100%;padding: 10px;position: absolute;top: 10px;left: 10px;border: solid red 2px; }#left .widget {width: 340px;height: 150px;padding; 10px;margin: 20px;border: solid red 2px;background-color: white;}#left .widget .widget-header {width: 340px;height: 30px;padding: 0;margin: 0;color: red;position: static;background-color: gray;}#middle{width: 400px;height: 100%;position: absolute;top:10px;left: 435px;padding: 10px;margin: 0 30px 0; border: solid red 2px; }#middle .widget {width: 360px;height: 150px;padding; 10px;margin: 20px;border: solid red 2px;background-color: white;}#middle .widget .widget-header {width: 360px;height: 30px;padding: 0;margin: 0;color: red;position: static;background-color: gray;}#right{width: 380px;height: 100%;padding: 10px;position: absolute;top: 10px;right: 10px;border: solid red 2px; }#right .widget {width: 340px;height: 150px;padding; 10px;margin: 20px;border: solid red 2px;background-color: white;}#right .widget .widget-header {width: 340px;height: 30px;padding: 0;margin: 0;color: red;position: static;background-color: gray;}

javascript代碼

$(document).ready(function(){ $.fn.EasyWidgets({i18n : { editText : '編輯', closeText : '關(guān)閉', extendText : '展開(kāi)', collapseText : '折疊', cancelEditText : '取消' }});});
 

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 林周县| 新乐市| 辛集市| 洛浦县| 洱源县| 祁门县| 博罗县| 吉木萨尔县| 泽州县| 朔州市| 景泰县| 秦皇岛市| 溧水县| 白玉县| 河南省| 太仓市| 贡山| 永康市| 台中市| 灌南县| 吴旗县| 武隆县| 阜城县| 蒙阴县| 清涧县| 天水市| 吉木乃县| 南涧| 亚东县| 玉树县| 务川| 特克斯县| 易门县| 泸水县| 黎川县| 北票市| 敦煌市| 荣成市| 乐东| 泽库县| 金秀|