Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ul id="selectable">
- <li>John Doe
- <br/>(111) 222-3333
- <br/><a href="mailto:john.doe@blah.com">john.doe@blah.com</a>
- <br/>
- <a href="/comments?user=15">3 comments</a>
- <br/>
- <br/>
- <a href="/users/15/edit">Edit</a>
- <a href="/users/15" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Delete</a>
- <hr/>
- </li>
- <li>Jane Smith
- <br/>(222) 333-4444
- <br/><a href="mailto:jane.smith@blah.com">jane.smith@blah.com</a>
- <br/>
- <a href="/comments?user=17">1 comment</a>
- <br/>
- <br/>
- <a href="/users/17/edit">Edit</a>
- <a href="/users/17" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Delete</a>
- <hr/>
- </li>
- </ul>
- <script>
- $(function() {
- $( "#selectable" ).selectable({
- selected: function(ev, ui) {
- //insert code here?
- }
- });
- });
- </script>
- <ul id="selectable">
- <li>John Doe
- <br/>(111) 222-3333
- <br/><a href="mailto:john.doe@blah.com">john.doe@blah.com</a>
- <br/>
- <a href="/comments?user=15">3 comments</a>
- <br/>
- <br/>
- <a href="/users/15/edit">Edit</a>
- <a href="/users/15" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Delete</a>
- <hr/>
- </li>
- </ul>
- $(function(){
- $('#selectable').selectable({
- selected: function(ev, ui) {
- //maybe do something
- }
- });
- $('#selectable li a').click(function(){
- var url = $(this).attr('href');
- if ($(this).data('confirm')) {
- var answer = confirm($(this).data('confirm'));
- var method = $(this).data('method');
- if (method && answer) {
- // execute method?
- // do redirect?
- window.location = url;
- }
- } else {
- window.location = url;
- }
- });
- });
Add Comment
Please, Sign In to add comment