PDA

View Full Version : Question about Ultimate Fade In Slideshow v2.0



CCompton
12-28-2011, 04:55 PM
Hey folks,
New to the forum, and a novice at best at coding. I have a question about embedding the "Ultimate Fade In Slideshow v2.0". Im trying to add this slide show to a template site that Im working on. the area Im adding it to is a smarty .tpl, so I cant really touch the head of the page. I added the Jquery line with little or no consequence, and dropped the res of the code into the html, and it seems to be working alright for me (in Fire Fox) . HOWEVER, when checking the site on other browsers ( Safari, Chrome) the slide show doesnt always load. you have to refresh a couple of times,....thoughts on how I can fix this??

djr33
12-28-2011, 10:51 PM
Unfortunately, some Javascript scripts really do need to go in the head section. That's not always true, but sometimes it is, and if not then you might need to modify the script (or it might not even be possible). I'm not that familiar with the code behind the specific script, but I can give you some info in general.

Is there any way at all that you can get the code into the <head> section? Sometimes when working with a template or other server side method, you need to actually add the script in two parts, once to the <head> section and once to the <body>. You might need to add the <head> section for ALL of your pages on the entire site. That's not convenient, but it won't hurt anything probably (except load time or bandwidth, although caching will help). Then when you actually want to USE the script, include that <body> content only in the template files where it should appear.

If you can't access the <head> section at all, then you may not be able to use this script; but that will be true about a lot of scripts, so if you need that sort of thing, then you'll need to find a different way to make your pages.

A templating engine like smarty is useful in some ways, but you will find limitations so working with the PHP directly will give you more control if you need it.