0

I know I can do something like:

  $(function() {
    $( ".className" ).draggable();
  });

If I want to make the class className draggable, but how about making all elements inside the page draggable ?

Alucard
  • 1,814
  • 1
  • 21
  • 33
  • 1
    Yowza. Trying to lock up the user's browser? :-) – isherwood Dec 03 '14 at 16:40
  • 2
    I'm dying to know why you want this! – Stijn Geukens Dec 03 '14 at 16:41
  • 1
    Hopefully, this would be just hypothetical, not real world, right? Like adding `*, *:before, *:after { transition: all 1s ease; }` to your CSS. – Phil Tune Dec 03 '14 at 16:43
  • 1
    If you know the elements you could make it slightly less taxing, ie if you are only using divs, p, h1, span, etc. And there could be lots of elements you don't need to target, especially inline elements, so these would not be selected by the * wildcard. – lharby Dec 03 '14 at 16:46

3 Answers3

3

Against all good sense you could do this:

$('body *').draggable();

Note that it's likely to severely tax most systems, though.

isherwood
  • 58,414
  • 16
  • 114
  • 157
2

$( "*" ).draggable(); Should do what you are asking

Zach Leighton
  • 1,939
  • 14
  • 24
2
$(function() {
    $('*').draggable();
});

P.S. DO NOT DO THIS... it will really slow down your browser.

Phil Tune
  • 3,154
  • 3
  • 24
  • 46