is there way deactivate child anchor <a href="..." /> elements of sortable element? example, have table table cells may contain links. table's sortable feature can turned on , off such links can clicked on whenever sortable turned off, cannot when turned on. possible?
jsfiddle: http://jsfiddle.net/frqqho75/
example:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <style> #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; } #sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; } #sortable li span { position: absolute; margin-left: -1.3em; } </style> <script> $(function() { $("#sortable").sortable({ disabled: true }); }); </script> </head> <body> <button onclick="$('#sortable').sortable('enable');">activate</button><button onclick="$('#sortable').sortable('disable');">deactivate</button> <ul id="sortable"> <li class="ui-state-default">item 1 <a href="test">link 1</a></li> <li class="ui-state-default">item 2 <a href="test">link 2</a></li> <li class="ui-state-default">item 3 <a href="test">link 3</a></li> </ul> </body> </html>
Comments
Post a Comment