Jquery help advice

Hi all

My first post so apologies if I’ve done anything incorrectly.

I’m after some jquery help and advice about where to place my js.

At present I’m putting this site together for a client.

Proofreading - We right what you write

It curently has 3 slideshows on the homepage at the clients request. My first question is about where to place my code. At the moment I have…

<script type="text/javascript">
$(document).ready(function() {
		fx: 'scrollLeft',
		speed:    600, 
        timeout:  5000,
		pause: 1,
		next:   '#next', 
        prev:   '#prev',
		cleartypeNoBg: 'true'

…in my head tag. It works fine but I’m reusing this for my other two slide shows which are the logos down the bottom of the page.

Is it correct to have this code 3 times, one after another in the head tag? or is there a better way to have this layed out?

Also I’m just testing in IE8 and there seem to be a few issues…ones I’ve noticed are

  • The bottom logo slide shows dont move at the same time as they do in firefox. so in firefox they move as one like it’s one long slideshow.

  • The top slideshow has a slight wobble in it and has now thrown in a mystery blank slide.

I’m kind of stumped here and would appreciate any help.


To eliminate 3 code blocks, you could create a function to do the slideshow, passing in the element id if necessary, then call it from document.ready and onclick.

They write for a living yet can’t supply you with copy, now that is funny.

The modern method is to place javaScript at the end of the body. That way the page can load without JS dragging it down.

Thanks oddz, that seemed to clear up everything.

Still have one issue in IE8. If you look at the top slide show it wobbles on the right when it moves.

Anybody have any ideas why?