你給每個可拖拽的div加一個class如果如:
成都創(chuàng)新互聯(lián)公司專注于企業(yè)成都營銷網(wǎng)站建設(shè)、網(wǎng)站重做改版、兩當(dāng)網(wǎng)站定制設(shè)計、自適應(yīng)品牌網(wǎng)站建設(shè)、H5開發(fā)、電子商務(wù)商城網(wǎng)站建設(shè)、集團(tuán)公司官網(wǎng)建設(shè)、成都外貿(mào)網(wǎng)站建設(shè)公司、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計等建站業(yè)務(wù),價格優(yōu)惠性價比高,為兩當(dāng)?shù)雀鞔蟪鞘刑峁┚W(wǎng)站開發(fā)制作服務(wù)。
左右容器的class:class_tz_left 和 class_tz_right
可拓展元素的class:class_child
然后在拖拽之前判斷
if($(".class_tz_left ").find(".class_child").length1){//判斷左側(cè)class_child是否大于1個
//可拖拽
}else{
//如果不大于一個那么左側(cè)就不可拖拽
}
右側(cè)寫法與上同理
//200多個插件如下?實際開發(fā)中?請選擇合適的使用
1:文件上傳類jQuery插件
Ajax?File?Upload.
jQUploader.
Multiple?File?Upload?plugin.
jQuery?File?Style.
Styling?an?input?type?file.
Progress?Bar?Plugin.
2:表單驗證類jQuery插件
jQuery?Validation.
Auto?Help.
Simple?jQuery?form?validation.
jQuery?XAV?–?form?validations.
jQuery?AlphaNumeric.
Masked?Input.
TypeWatch?Plugin.
Text?limiter?for?form?fields.
Ajax?Username?Check?with?jQuery.
3:表單選擇框類jQuery插件
jQuery?Combobox.
jQuery?controlled?dependent?(or?Cascadign)?Select?List.
Multiple?Selects.
Select?box?manipulation.
Select?Combo?Plugin.
jQuery?–?LinkedSelect
Auto-populate?multiple?select?boxes.
Choose?Plugin?(Select?Replacement).
4:表單基本、輸入框、選擇框等jQuery插件
jQuery?Form?Plugin.
jQuery-Form.
jLook?Nice?Forms.
jNice.
Ping?Plugin.
Toggle?Form?Text.
ToggleVal.
jQuery?Field?Plugin.
jQuery?Form’n?Field?plugin.
jQuery?Checkbox?manipulation.
jTagging.
jQuery?labelcheck.
Overlabel.
3?state?radio?buttons.
ShiftCheckbox?jQuery?Plugin.
Watermark?Input.
jQuery?Checkbox?(checkboxes?with?imags).
jQuery?SpinButton?Control.
jQuery?Ajax?Form?Builder.
jQuery?Focus?Fields.
jQuery?Time?Entry.
5:時間、日期和顏色選取類jQuery插件
jQuery?UI?Datepicker.
jQuery?date?picker?plugin.
jQuery?Time?Picker.
Time?Picker.
ClickPick.
TimePicker.
Farbtastic?jQuery?Color?Picker?Plugin.
Color?Picker?by?intelliance.fr.
6:投票類jQuery插件
jQuery?Star?Rating?Plugin.
jQuery?Star?Rater.
Content?rater?with?asp.net,?ajax?and?jQuery.
Half-Star?Rating?Plugin.
7:搜索類jQuery插件
jQuery?Suggest.
jQuery?Autocomplete.
jQuery?Autocomplete?Mod.
jQuery?Autocomplete?by?AjaxDaddy.
jQuery?Autocomplete?Plugin?with?HTML?formatting.
jQuery?Autocompleter.
AutoCompleter?(Tutorial?with?PHPMySQL).
quick?Search?jQuery?Plugin.
8:jQuery編輯器插件
jTagEditor.
WYMeditor.
jQuery?jFrame.
Jeditable?–?edit?in?place?plugin?for?jQuery.
jQuery?editable.
jQuery?Disable?Text?Select?Plugin.
Edit?in?Place?with?Ajax?using?jQuery.
jQuery?Plugin?–?Another?In-Place?Editor.
TableEditor.
tEditable?–?in?place?table?editing?for?jQuery.
9:多媒體、視頻、Flash等類jQuery插件
jMedia?–?accessible?multi-media?embedding.
JBEdit?–?Ajax?online?Video?Editor.
jQuery?MP3?Plugin.
jQuery?Media?Plugin.
jQuery?Flash?Plugin.
Embed?QuickTime.
SVG?Integration.
圖片類jQuery插件
ThickBox.
jQuery?lightBox?plugin.
jQuery?Image?Strip.
jQuery?slideViewer.
jQuery?jqGalScroll?2.0.
jQuery?–?jqGalViewII.
jQuery?–?jqGalViewIII.
jQuery?Photo?Slider.
jQuery?Thumbs?–?easily?create?thumbnails.
jQuery?jQIR?Image?Replacement.
jCarousel?Lite.
jQPanView.
jCarousel.
Interface?Imagebox.
Image?Gallery?using?jQuery,?Interface??Reflactions.
simple?jQuery?Gallery.
jQuery?Gallery?Module.
EO?Gallery.
jQuery?ScrollShow.
jQuery?Cycle?Plugin.
jQuery?Flickr.
jQuery?Lazy?Load?Images?Plugin.
Zoomi?–?Zoomable?Thumbnails.
jQuery?Crop?–?crop?any?image?on?the?fly.
Image?Reflection.
10:Google地圖類jQuery插件應(yīng)用
jQuery?Plugin?googlemaps.
jMaps?jQuery?Maps?Framework.
jQmaps.
jQuery??Google?Maps.
jQuery?Maps?Interface?forr?Google?and?Yahoo?maps.
jQuery?J?Maps?–?by?Tane?Piper.
11:游戲類jQuery插件
Tetris?with?jQuery.
jQuery?Chess.
Mad?Libs?Word?Game.
jQuery?Puzzle.
jQuery?Solar?System?(not?a?game?but?awesome?jQuery?Stuff).
12:表格,網(wǎng)格類jQuery插件
UI/Tablesorter.
jQuery?ingrid.
jQuery?Grid?Plugin.
Table?Filter?–?awesome!.
TableEditor.
jQuery?Tree?Tables.
Expandable?“Detail”?Table?Rows.
Sortable?Table?ColdFusion?Costum?Tag?with?jQuery?UI.
jQuery?Bubble.
TableSorter.
Scrollable?HTML?Table.
jQuery?column?Manager?Plugin.
jQuery?tableHover?Plugin.
jQuery?columnHover?Plugin.
jQuery?Grid.
TableSorter?plugin?for?jQuery.
tEditable?–?in?place?table?editing?for?jQuery.
jQuery?charToTable?Plugin.
jQuery?Grid?Column?Sizing.
jQuery?Grid?Row?Sizing.
13:統(tǒng)計類jQuery插件
jQuery?Wizard?Plugin?.
jQuery?Chart?Plugin.
Bar?Chart.
14:邊框、圓角、背景類jQuery插件
jQuery?Corner.
jQuery?Curvy?Corner.
Nifty?jQuery?Corner.
Transparent?Corners.
jQuery?Corner?Gallery.
Gradient?Plugin.
14:文字和超鏈接類jQuery插件
jQuery?Spoiler?plugin.
Text?Highlighting.
Disable?Text?Select?Plugin.
jQuery?Newsticker.
Auto?line-height?Plugin.
Textgrad?–?a?text?gradient?plugin.
LinkLook?–?a?link?thumbnail?preview.
pager?jQuery?Plugin.
shortKeys?jQuery?Plugin.
jQuery?Biggerlink.
jQuery?Ajax?Link?Checker.
15:文本提示類jQuery插件
jQuery?Plugin?–?Tooltip.
jTip?–?The?jQuery?Tool?Tip.
clueTip.
BetterTip.
Flash?Tooltips?using?jQuery.
ToolTip.
16:菜單和導(dǎo)航類jQuery插件
jQuery?Tabs?Plugin?–?awesome!?.?[demo?nested?tabs.]
another?jQuery?nested?Tab?Set?example?(based?on?jQuery?Tabs?Plugin).
jQuery?idTabs.
jdMenu?–?Hierarchical?Menu?Plugin?for?jQuery.
jQuery?SuckerFish?Style.
jQuery?Plugin?Treeview.
treeView?Basic.
FastFind?Menu.
Sliding?Menu.
Lava?Lamp?jQuery?Menu.
jQuery?iconDock.
jVariations?Control?Panel.
ContextMenu?plugin.
clickMenu.
CSS?Dock?Menu.
jQuery?Pop-up?Menu?Tutorial.
Sliding?Menu.
17:幻燈片、手風(fēng)琴特效類jQuery插件
jQuery?Plugin?Accordion.
jQuery?Accordion?Plugin?Horizontal?Way.
haccordion?–?a?simple?horizontal?accordion?plugin?for?jQuery.
Horizontal?Accordion?by?portalzine.de.
HoverAccordion.
Accordion?Example?from?fmarcia.info.
jQuery?Accordion?Example.
jQuery?Demo?–?Expandable?Sidebar?Menu.
Sliding?Panels?for?jQuery.
jQuery?ToggleElements.
Coda?Slider.
jCarousel.
Accesible?News?Slider?Plugin.
Showing?and?Hiding?code?Examples.
jQuery?Easing?Plugin.
jQuery?Portlets.
AutoScroll.
Innerfade.
18:拖放類jQuery插件
UI/Draggables.
EasyDrag?jQuery?Plugin.
jQuery?Portlets.
jqDnR?–?drag,?drop?resize.
Drag?Demos.
19:XML?XSL?JSON?Feeds相關(guān)jQuery插件
XSLT?Plugin.
jQuery?Ajax?call?and?result?XML?parsing.
xmlObjectifier?–?Converts?XML?DOM?to?JSON.
jQuery?XSL?Transform.
jQuery?Taconite?–?multiple?Dom?updates.
RSS/ATOM?Feed?Parser?Plugin.
jQuery?Google?Feed?Plugin.
20:瀏覽器
Wresize?–?IE?Resize?event?Fix?Plugin.
jQuery?ifixpng.
jQuery?pngFix.
Link?Scrubber?–?removes?the?dotted?line?onfocus?from?links.
jQuery?Perciformes?–?the?entire?suckerfish?familly?under?one?roof.
Background?Iframe.
QinIE?–?for?proper?display?of?Q?tags?in?IE.
jQuery?Accessibility?Plugin.
jQuery?MouseWheel?Plugin.
21:警告,?提示,?確認(rèn)等對話框
jQuery?Impromptu.
jQuery?Confirm?Plugin.
jqModal.
SimpleModal.
CSS
jQuery?Style?Switcher.
JSS?–?Javascript?StyleSheets.
jQuery?Rule?–?creation/manipulation?of?CSS?Rules.
jPrintArea.
22:DOM、AJAX和其它JQuery插件
FlyDOM.
jQuery?Dimenion?Plugin.
jQuery?Loggin.
Metadata?–?extract?metadata?from?classes,?attributes,?elements.
Super-tiny?Client-Side?Include?Javascript?jQuery?Plugin.
Undo?Made?Easy?with?Ajax.
JHeartbeat?–?periodically?poll?the?server.
Lazy?Load?Plugin.
Live?Query.
jQuery?Timers.
jQuery?Share?it?–?display?social?bookmarking?icons.
jQuery?serverCookieJar.
jQuery?autoSave.
jQuery?Puffer.
jQuery?iFrame?Plugin.
Cookie?Plugin?for?jQuery.
jQuery?Spy?–?awesome?plugin.
Effect?Delay?Trick.
jQuick?–?a?quick?tag?creator?for?jQuery..
jquery是對原生javascript的封裝,框架。
jquery ui 是jquery的一個擴(kuò)展,也可以理解為插件。jquery ui 是基于jquery寫的一系列UI方面的框架。
jquery ui 可以說是官方插件。
一般你用的插件是民間的,你可以寫一個,我也可以寫一個就是大家都可以基于jquery寫jquery的擴(kuò)展。
jquery mobile 是針對移動客戶端的框架,其中實現(xiàn)了滑動等移動客戶端才有的動作等一些特性。
用1.9.2版的吧,可能是因為jquery2.0已經(jīng)不支持ie 6 7 8了,新的360是能比較好的支持html5 和css3 雖然有些地方有問題
1.引用js和css
2.定義tabs:
var $tabs = $("#tabs").tabs({
tabTemplate: "lia href='#{href}'#{label}/a span class='ui-icon ui-icon-close'Remove Tab/span/li",
add:function(event, ui){
$tabs.tabs('select', ui.index);
}
});
3.定義點擊時的方法:
$("a").click(function(){
$href = $(this).attr("id");
$title = $(this).text();
$tabs.tabs( "add", $href,$title);
});
希望可以幫助到你
(1)jQuery是一個js庫,主要提供的功能是選擇器,屬性修改和事件綁定等。
(2)jQuery UI則是在jQuery的基礎(chǔ)上,利用jQuery的擴(kuò)展性,設(shè)計的插件。提供了一些常用的界面元素,諸如對話框、拖動行為、改變大小行為等。
在運用中會有閉包, 由于函數(shù)內(nèi)部定義變量作用域問題,如果外部想用這個內(nèi)部函數(shù)創(chuàng)建的一個變量;那就需要在這個函數(shù)內(nèi)部在創(chuàng)建一個函數(shù),創(chuàng)建的這個函數(shù)相當(dāng)于一個橋梁把內(nèi)部外部函數(shù)的變量拋出,這樣就解決了不能訪問這個變量的問題,那這個內(nèi)部函數(shù)就稱為閉包。
其具體特性如下:
a.函數(shù)內(nèi)再嵌套函數(shù)
b.內(nèi)部函數(shù)可以引用外層的參數(shù)和變量
c.參數(shù)和變量不會被垃圾回收機(jī)制回收
概括的說,閉包就是能夠讀取其他函數(shù)內(nèi)部變量的函數(shù),在本質(zhì)上,它是將函數(shù)內(nèi)部和函數(shù)外部連接起來的一座橋梁。