AshesOfOwls / jquery.shapeshift

A dynamic grid system with drag and drop functionality.
http://ashesofowls.github.com/jquery.shapeshift/
MIT License
1.67k stars 311 forks source link

TypeError: first_child is undefined #95

Open faaabii opened 10 years ago

faaabii commented 10 years ago

I built a small dashboard and used SQL to save the custom order of an user. When there is no custom order it will get its default order from the database.

Now I use ajax and jquery to load my widgets dynamically into the container-div. Therefore I can't load shapeshift directly in my html-file.

I put the whole shapeshift code directly after declaring the widgets. When I load the page for the first time it throws the error

first_child is undefined

When I reload the page, everythings fine.

I already found out, that the problem is the missing shapeshift-code in the html-file.

Does anyone have a clue what to do to declare shapeshift in an external file?

It would be great, thanks in advance!

faaabii commented 10 years ago

My bad, I just got it working. In my page I have several divs I can display and till now I tried to declare my container before making it visible... when I first make it visible and declare shape shift later, it works.