Execute
Save
Share
Share link
share
share
share
Team
Public Teams
Comments
0
Created By:
Guest
Title:
Change Class on Drag n Drop
Title
Description
Edit
Copy Link
Login
Email *
Password *
Login
OR
Create Account
Screen Name *
Email *
Password *
Retype Password *
Team Access Code
Register
Public CodeBins
HELP
--Select Theme--
Ambiance
Blackboard
Cobalt
Eclipse
Elegant
Erlang-Dark
Lesser-Dark
Monokai
Neat
Night
Rubyblue
Vibrant-Ink
Xq-Dark
New CodeBin
CodeBins Versions
Change Class on- V.10
Change Class on- V.9
Change Class on- V.8
Change Class on- V.7
Change Class on- V.6
Change Class on- V.5
Change Class on- V.4
Change Class on- V.3
Change Class on- V.2
Change Class on- V.1
Compare Versions
Recent CodeBins
View All CodeBins
var lists = [{ "listid": "#all-colls-list", "connectid": "#coll-selected-list" }, { "listid": "#coll-selected-list", "connectid": "#all-colls-list" }]; $.each(lists, function(i, list) { $(list.listid).sortable({ connectWith: list.connectid, opacity: 0.7, start: function(event, ui) { if ($(ui.item).parents('#all-colls-list').length > 0) { $(ui.item).addClass('dropped'); $(ui.item).text("zahir if"); } else { $(ui.item).addClass('sorted'); $(ui.item).text("zahir else"); } }, stop: function(event, ui) { if ($(ui.item).parents('#all-colls-list').length > 0) { $(ui.item).switchClass('droppedli', 'sortedli'); $(ui.item).text("zahir stop if"); alert("hello"); } else { $(ui.item).switchClass('sortedli', 'droppedli'); $(ui.item).text("zahir stop else"); } } }); });
Bottom of Page
In Head
On Load
On Ready
Setting
Validate
Copy
Format
#all-colls-list{ display:inline-block; width:200px; border:1px solid #331299; background-color:#fff; height:auto; } #coll-selected-list{ display:inline-block; width:200px; border:1px solid #331299; background-color:#fff; height:auto; } #all-colls-list li{ background-color:#2277a7; margin:10px; } #coll-selected-list li{ background-color:#a74455; margin:10px; } #all-colls-list li, #coll-selected-list li{ list-style:none; } #all-colls-list li:hover, #coll-selected-list li:hover{ cursor:move; border:2px solid #A1B177; } .dropped{ background-color:#2277a7; } .sorted{ background-color:#a74455; }
Setting
Validate
Copy
Format
<ul id="all-colls-list" class="droptrue ui-sortable"> <li class="sortedli"> è—1 </li> <li class="sortedli"> è—2 </li> <li class="sortedli"> è—3 </li> </ul> <ul id="coll-selected-list" class="droptrue ui-sortable"> <li class="sortedli" style=""> ç´…1 </li> <li class="sortedli" style=""> ç´…2 </li> <li class="sortedli" style=""> ç´…3 </li> </ul>
No Doc Type
HTML5
HTML 4.01 Transitional
HTML 4.01 Strict
HTML 4.01 Frameset
XHTML 1.1
XHTML 1.0 Transitional
XHTML 1.0 Strict
XHTML 1.0 Frameset
Copy
Format
Download
×
Code Description
×
Difference of Versions
HTML
CSS
JS
×
JS Error
×
CSS Error
Errors
Warnings
×
JavaScript Setting
JS Libraries:
Chrome Frame 1.0.3
Dojo 1.8.0
Dojo 1.7.3
Dojo 1.7.2
Ext Core 3.1.0
jQuery 1.8.0
jQuery 1.7.2
jQuery 1.6.0
jQuery 1.5.0
jQuery 1.4.4
jQuery 1.4.0
jQuery-min 1.7.2
jQueryUI-min 1.8.21
MooTools more-1.4.0.1-full
MooTools core-1.4.5-full
MooTools core-1.4.1-full
Prototype 1.7.1.0
script.aculo.us 1.9.0
SWFObject 2.2
Twitter Bootstrap 2.0.4
WebFont Loader 1.0.28
yui 3.5.1
User Libraries:
Upload File
JavaScript URL(s):
×
CSS Setting
CSS Libraries:
jQueryUI 1.8.21
Twitter Bootstrap 2.0.4
User Libraries:
Upload File
CSS URL(s):