anyone? bueller?
On 30 Mar, 13:23, "lukemack"
<lukemst...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
>
> I am using the following code to test some drag and drop functionality
> I would like to add to a php app (non-rails). The aim is for the user
> to be able to drag and drop some pdf icons to a drop area. They will
> then click a link to download the pdfs as a zip file.
>
> I''ve got a basic drag and drop working but I want a duplicate of
the
> item i dragged to appear in the drop area (should
''accepts'' do this?)
> and i then need to access the array of items i have in the drop area
> and pass them to a php script to handle the download.
>
> Can anyone give me some pointers on getting this working? Code
> follows. I have taken a look at the shopping cart demo but the
> javascript syntax is a bit beyond me.
>
> thanks,
>
> lukemack.
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <script src="js/prototype.js"
type="text/javascript"></script>
> <script src="js/scriptaculous.js"
type="text/javascript"></script>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1" />
> <title>Untitled Document</title>
>
> </head>
>
> <body>
> <style>
>
> .pdf{ border: 1px dotted #ccc}
>
> #drag{
> float:left;
> height:400px;
> width:400px;
> border: 1px dashed #ccc;
>
> }
>
> #drop{
>
> float:right;
> border: 1px dashed #ccc;
> height:400px;
> width:400px;
>
> }
>
> </style>
>
> <div id ="drag" ><img id="drag1"
class="pdf" src="file:////site
> graphics/phones.gif" width="29" height="30"
alt="headphones"/></div>
> <script type="text/javascript"
language="javascript">
> new Draggable(''drag1'',{revert:true});
>
> </script>
> <div id ="drop"></div>
> <script type="text/javascript"
language="javascript">
> // from the shopping cart demo
> Droppables.add(''drop'', {accept: ''pdf'',
onDrop: function(element) { $
> (''drop'').innerHTML = ''Dropped the '' +
element.alt + '' on me.''; }});
>
> </script>
> </body>
> </html>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---