PDA

View Full Version : formatting - forcing a javascript element to load last



iopener
02-13-2007, 03:27 PM
Hello,

I have this page, which doesn't always display correctly: http://www.iopener.co.uk/happinessquestionnaire/step1.html

It has numerous javascript 'sliders' on the page. The javascript file for these sliders is located here: http://www.iopener.co.uk/happinessquestionnaire/slider.js

I need some way to ensure that the sliders are correctly aligned on the page.

Often, when I load the page, particularly in Safari, the sliders each appear about 50px above where they should be. (Refreshing the page normally makes them align as they should be aligned). I think a possible solution would be to make sure the sliders load after the rest of the page, but I've already linked to the javascript file in the header of the html so I don't know what else I can do to force this to happen.

Any help greatly appreciated.
Thanks,
Ian

shachi
02-13-2007, 04:31 PM
maybe this is your problem?



<table width="630" border="0" cellspacing="0" cellpadding="0"
<tr>
<td style="text-align:right; padding:20px 0 40 0px; border:0px;">
<input type="hidden" name="step_completed" value="1" />
<br>
<div align="right"><input type="button" value="Analyze me!" class="button" onclick="javascript:valida()"/></div>

<br>&nbsp;
</td>
</tr>
</table>

iopener
02-13-2007, 05:02 PM
Sorry but I don't understand. Could you elaborate please? Thanks for your help.

shachi
02-17-2007, 12:40 PM
iopener: you haven't closed the tag.

mburt
02-17-2007, 01:39 PM
Closing the tag means to add the "/>" shachi, I think you mean ending the tag:

<table width="630" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align:right; padding:20px 0 40 0px; border:0px;">
<input type="hidden" name="step_completed" value="1" />
<br>
<div align="right"><input type="button" value="Analyze me!" class="button" onclick="javascript:valida()"/></div>

<br>&nbsp;
</td>
</tr>
</table>

shachi
02-18-2007, 09:09 AM
Thanks for pointing that out mburt.