A Programmer's Dream

Dynamically Generated Divs

Posted by Stephen Wrighton on 23 Apr 2007

For my freelance project, I'm creating a bunch of HTML DIV elements and using Prototype and the Scriptaculous JavaScript library making them Drag/Droppable.

Not a big deal, and the DIVS are being generated - and even drag/drop. But of course there are some errors. And of course, it's different ones for FireFox and IE.

In IE, the classes that I associate with the DIV aren't being applied for whatever reason. Of secondary issue is that since the class is not being applied, the DIV that the elements are dropped into is not registering it as a drop.

In FireFox, when I drop the dynamically created DIV onto the DIV that accepts it, the dynamically created DIV reverts to the top left corner of the page rather than the place where I had gotten it out from.

So, I get to do a decent amount of research in the upcoming short term. Yeah me.

Tweet me @kidananubix if you like this post.