各種效果的jquery ui(接口)介紹
基本的鼠標(biāo)互動(dòng):
拖拽(drag and dropping)、排序(sorting)、選擇(selecting)、縮放(resizing)
各種互動(dòng)效果:
手風(fēng)琴式的折疊菜單(accordions)、日歷(date pickers)、對話框(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 對話框
所需要的文件:
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頁簽(對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
相關(guān)文章
jQuery實(shí)現(xiàn)每日秒殺商品倒計(jì)時(shí)功能
這篇文章主要介紹了 jQuery實(shí)現(xiàn)每日秒殺商品倒計(jì)時(shí)功能,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-09-09學(xué)習(xí)從實(shí)踐開始之jQuery插件開發(fā) 菜單插件開發(fā)
從軟件到網(wǎng)站,菜單可以說是無處不在。在傳統(tǒng)應(yīng)用軟件開發(fā)中,一般都有現(xiàn)成的控件可以使用;但是在網(wǎng)頁開發(fā)時(shí),基本上要靠開發(fā)人員自己動(dòng)手設(shè)計(jì)2012-05-05jquery實(shí)現(xiàn)郵箱自動(dòng)補(bǔ)全功能示例分享
這篇文章主要介紹了jquery實(shí)現(xiàn)郵箱自動(dòng)補(bǔ)全功能,大家參考使用吧2014-02-02JQuery select控件的相關(guān)操作實(shí)現(xiàn)代碼
JQuery獲取和設(shè)置Select選項(xiàng)方法匯總?cè)缦?,需要的朋友可以參考?/div> 2012-09-09最新評論