Hello, I''m trying to use the drag and drop in my web app so that users can reposition images in their album. But am not having much luck. I''ve implemented as follows: header stuff... <script src="/js/prototype.js" type="text/javascript"></script> <script src="/js/common.js" type="text/javascript"></script> <script src="/js/albums.js" type="text/javascript"></script> <script src="/js/lightbox.js" type="text/javascript"></script> <script src="/js/scriptaculous.js?load=effects,dragdrop" type="text/javascript"></script> <body> <ul id="album-images"> <style type="text/css">.images { width: 70px; height: 70px; }</style> <li class="images"> <img src="blahblah..." /> </li> <li class="images"> </li> </ul> <script type="text/javascript"> Sortable.create( "album-images", { dropOnEmpty: true, containment: "album-images", constraint: false } ); </script> </body> </html> I am getting to the following error: "element has no value dragdrop.js line 584" which is at: _findRootElement: function(element) { It seems that the code is calling create: function(element) { element = $(element); in "create:" and then calling, on line 592, in function options: element = Sortable._findRootElement($(element)); so $( $( "album-images" ) ) which of course is null If I work around this error, I get the same error in prototype.js. Since no one else is having this problem, I assume that I have done something wrong. I pulled the tarball 1.6.4 off the site just a few days ago. Thanks in advance for any help or ideas!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey there, greanie a écrit :> <ul id="album-images"> > so $( $( "album-images" ) ) which of course is nullWhy would it be? $ is designed so that multiple calls are harmless. It''s equivalent to a single call.> Since no one else is having this problem, I assume that I have done > something wrong. I pulled the tarball 1.6.4 off the site just a few > days ago.Can you put a minimalistic reproduction online, so we can fiddle with it and help you out? -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I found my problem. I wrote the common.js about a year ago and forgot that I had $ redefined and that was overriding the prototype version of $. My version of $ was not designed to handle multiple, nested calls to $ :-) Thanks for you reply and help! greanie On Nov 7, 5:04 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey there, > > greanie a écrit : > > > <ul id="album-images"> > > so $( $( "album-images" ) ) which of course is nullWhy would it be? $ is designed so that multiple calls are harmless. > It''s equivalent to a single call. > > > Since no one else is having this problem, I assume that I have done > > something wrong. I pulled the tarball 1.6.4 off the site just a few > > days ago.Can you put a minimalistic reproduction online, so we can fiddle with it > and help you out? > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---