Advertisement

body onLoad crashing Dragable Content script

Moderators: Calcifer, slothy

body onLoad crashing Dragable Content script

Postby aliceaod » Tue Aug 11, 2009 10:47 am

I would like to use the Dragable Content found here:

http://www.dhtmlgoodies.com/index.html? ... le-content

The Dragable Content will not work if I have any body onLoad in my page.

I have 2 onLoads which work fine for what they're supposed to do. I read in another thread about creating a function for calling several onloads with one function, and tried that, but then my scripts don't work *and* the Dragable Content doesn't work either. If I have any body onLoad (ie: <body onLoad="init_scripts();">) it will crash the Dragable Content Script. The boxes and images appear, but they are static (can't be dragged).

The moment I take out the onLoad, the drag and save to cookie works fine. How do I get the Dragable Content script to work with a body onLoad?
aliceaod
 
Posts: 13
Joined: Tue Aug 11, 2009 10:31 am

Postby aliceaod » Wed Aug 12, 2009 6:01 am

Not, not live yet, still working with this locally using WAMP...however, I *think* I have it figured out.

Rather than have <body onLoad "startres(); inittabs();">, I put this in my footer...

<script type="text/javascript">
startres();</script>
<script type="text/javascript">
inittabs();
</script>

Seems to be working so far...I haven't fully tested this on all the pages but I think that might be my solution. If I run into additional problems, I'll let you know, but thanks for getting back to me so quickly. Truly appreciate it.

Unless someone else has this working with a body onLoad, I don't think it works with one....
aliceaod
 
Posts: 13
Joined: Tue Aug 11, 2009 10:31 am

Postby aliceaod » Wed Aug 12, 2009 8:46 am

Oh, yes, typo on my part when I posted, I did not copy and paste the code from my html document and thanks for the tip about the stuff in the footer.

One thing I noticed about the drag script is that it doesn't "play nice" with a dom rollover that I'm using on the images.

The image rollover affect works initially but once the images are moved, the rollover quits working.
aliceaod
 
Posts: 13
Joined: Tue Aug 11, 2009 10:31 am


Return to Drag and drop scripts

Who is online

Users browsing this forum: No registered users and 3 guests

cron