Hello everybody,
I''m using scriptaculous to aplly drag and drop effect on différent div
but i''have some troube with Internet explorer (6 & 7 ).
On my web page i have this structure (made with different div) :
http://img73.imageshack.us/img73/6858/boxjr2.gif
Each div which can receive an draggable element have a declaration
like this :
var products = document.getElementsByClassName(''droppable'');
for (var i = 0; i < products.length; i++) {
new Draggable(products[i].id, {ghosting:true, revert:true})
}
Droppables.add(''principal'', {onDrop:addProduct}).
When i load my web page i have only one div which can receive an
draggable element. But the user can add some draggable zone with a
javascript call :
<a href="#" onClick="drag(1)"> test 1 </a>
<a href="#" onClick="drag(2)"> test 2 </a>
function drag(type)
{
if(type==1)
{
var products =
document.getElementsByClassName(''droppable'');
for (var i = 0; i < products.length; i++) {
new Draggable(products[i].id, {ghosting:true, revert:true})
}
Droppables.add(''principal'', {onDrop:addProduct}).
}
if(type==2)
{
var products =
document.getElementsByClassName(''droppable'');
for (var i = 0; i < products.length; i++) {
new Draggable(products[i].id, {ghosting:true, revert:true})
}
Droppables.add(''principal'', {onDrop:addProduct}).
var products =
document.getElementsByClassName(''droppable'');
for (var i = 0; i < products.length; i++) {
new Draggable(products[i].id, {ghosting:true, revert:true})
}
Droppables.add(''second, {onDrop:addProduct}).
}
}
So if user click on "test 2 " the div with "second" id can
receive
draggable object. With Firefox , Opera or safari , no worries but on
Internet Explorer this action return an error :
Line : 3082 ( i dont have 3082 lines on my script)
Character : 7
Code : 0
Error Message : Non specified error
(With firebug on FF , there is no error)
And i can''t drag any object anymore
If someone have an idea to help me , it will be great :D
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---