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

首頁 > 編程 > JavaScript > 正文

各種效果的jquery ui(接口)介紹

2019-11-21 01:38:02
字體:
供稿:網(wǎng)友

基本的鼠標(biāo)互動(dòng):
拖拽(drag and dropping)、排序(sorting)、選擇(selecting)、縮放(resizing)

各種互動(dòng)效果:
手風(fēng)琴式的折疊菜單(accordions)、日歷(date pickers)、對(duì)話框(dialogs)、滑動(dòng)條(sliders)、表格排序(table sorters)、頁簽(tabs)、放大鏡效果(magnifier)、陰影效果(shadow)

第一部分:鼠標(biāo)交互
1.1 Draggables:拖拽
所需文件:
ui.mouse.js
ui.draggable.js
ui.draggable.ext.js

用法:文件載入后,可以拖拽class = "block"的層
$(document).ready(function(){
    $(".block").draggable();
});

draggable(options)可以跟很多選項(xiàng)
選項(xiàng)說明:http://docs.jquery.com/UI/Draggables/draggable#options
選項(xiàng)實(shí)例:http://dev.jquery.com/view/trunk/plugins/ui/tests/draggable.html

1.2 Droppables
所需要文件,drag drop
ui.mouse.js
ui.draggable.js
ui.draggable.ext.js
ui.droppable.js
ui.droppable.ext.js
用法:
$(document).ready(function(){
    $(".block").draggable({helper: 'clone'});
$(".drop").droppable({
   accept: ".block",
   activeClass: 'droppable-active',
   hoverClass: 'droppable-hover',
   drop: function(ev, ui) {
       $(this).append("<br>Dropped!");
   }
});
});
選項(xiàng)說明:http://docs.jquery.com/UI/Droppables/droppable#options
選項(xiàng)實(shí)例:http://dev.jquery.com/view/trunk/plugins/ui/tests/droppable.html

1.3 Sortables 排序
所需要的文件
jquery.dimensions.js
ui.mouse.js
ui.draggable.js
ui.droppable.js
ui.sortable.js
用法:
$(document).ready(function(){
    $("#myList").sortable({});
});
dimensions文檔http://jquery.com/plugins/project/dimensions
選項(xiàng)說明:http://docs.jquery.com/UI/Sortables/sortable#options
選項(xiàng)實(shí)例:http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.sortable.html

1.4 Selectables 選擇
所需要的文件
jquery.dimensions.js
ui.mouse.js
ui.draggable.js
ui.droppable.js
ui.selectable.js
用法:
$(document).ready(function(){
    $("#myList").selectable();
});
選項(xiàng)說明:http://docs.jquery.com/UI/Selectables/selectable#options
選項(xiàng)實(shí)例:http://dev.jquery.com/view/trunk/plugins/ui/tests/selectable.html

1.5 Resizables改變大小
所需要的文件 ,此例子需要幾個(gè)css文件
jquery.dimensions.js
ui.mouse.js
ui.resizable.js
用法:
$(document).ready(function(){
    $("#example").resizable();
});
CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
選項(xiàng)說明:http://docs.jquery.com/UI/Resizables/resizable#options
選項(xiàng)實(shí)例:http://dev.jquery.com/view/trunk ... s/ui.resizable.html

第二部分:互動(dòng)效果
2.1 Accordion 折疊菜單
所需要的文件:
ui.accordion.js
jquery.dimensions.js
用法:
$(document).ready(function(){
    $("#example").accordion();
});
CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
選項(xiàng)說明:http://docs.jquery.com/UI/Accordion/accordion#options
選項(xiàng)實(shí)例:http://dev.jquery.com/view/trunk/plugins/accordion/?p=1.1.1
2.2 dialogs 對(duì)話框
所需要的文件:
jquery.dimensions.js
ui.dialog.js
ui.resizable.js
ui.mouse.js
ui.draggable.js

用法:
$(document).ready(function(){
    $("#example").dialog();
});
CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
選項(xiàng)說明:http://docs.jquery.com/UI/Dialog/dialog#options
選項(xiàng)實(shí)例:http://dev.jquery.com/view/trunk/plugins/ui/tests/dialog.html

2.3 sliders 滑動(dòng)條
所需要的文件
jquery.dimensions.js
ui.mouse.js
ui.slider.js

用法:
$(document).ready(function(){
    $("#example").slider();
});

CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
選項(xiàng)說明:http://docs.jquery.com/UI/Slider/slider#options
選項(xiàng)實(shí)例:http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.slider.html

2.4 Tablesorter表格排序
所需要的文件
ui.tablesorter.js

用法:
$(document).ready(function(){
    $("#example").tablesorter({sortList:[[0,0],[2,1]], widgets: ['zebra']});
});

CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
選項(xiàng)說明:http://docs.jquery.com/Plugins/Tablesorter/tablesorter#options
選項(xiàng)實(shí)例:http://tablesorter.com/docs/#Demo

2.5 tabs頁簽(對(duì)IE支持不是很好)
所需要的文件
ui.tabs.js
用法:
$(document).ready(function(){
    $("#example > ul").tabs();
});
CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
選項(xiàng)說明:http://docs.jquery.com/UI/Tabs/tabs#initialoptions
選項(xiàng)實(shí)例:http://dev.jquery.com/view/trunk/plugins/ui/tests/tabs.html
tabs ext http://stilbuero.de/jquery/tabs_3/rotate.html

第三部分:效果
3.1 Shadow 陰影
實(shí)例http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.shadow.html
3.2 Magnifier 放大
實(shí)例http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.magnifier.html

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 老河口市| 德化县| 阳山县| 江油市| 织金县| 鞍山市| 建德市| 南通市| 东乡| 余江县| 通城县| 长治县| 松滋市| 威远县| 柳江县| 左贡县| 呼伦贝尔市| 晋城| 凤庆县| 洛宁县| 徐汇区| 时尚| 普宁市| 昌图县| 柞水县| 乐陵市| 永济市| 闽侯县| 台山市| 凭祥市| 行唐县| 繁峙县| 开化县| 北川| 什邡市| 彰化县| 镇平县| 昭觉县| 河北省| 司法| 阜新|