PDA

View Full Version : Simple Controls Gallery Problems when moving folder from beta to root



JeremyDolan
04-23-2009, 10:56 PM
1) Script Title: Simple Controls Gallery v1.3

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm

3) Describe problem: I'm building a blog section for a client. http://www.dynamicvfx.com/beta/blog.php and all had been going to plan until I moved the site from the beta folder to the root. http://www.dynamicvfx.com/blog.php I copied all the files and the folders (including the scripts) They're all in the correct relative positions as far as I can tell and I've checked the links in the html code but there's strange things going on.

In Safari it shows broken images, and seems to be adding a prefix to the script and image <a ref but doesn't show anything in FF. Looking at the source code brings up exactly what I have in DW.

At first I thought it must be because it's being used elsewhere but deleting the working files from the beta folder did nothing. I've tried using absolute URLs but that doesn't seem to help, I've tried moving files, renaming scripts, putting scripts into separate folders - everything I can think of!
I've eventually hacked it and put links (for now) through to the working version, still in the beta folder. Though not ideal, I'm hoping this will tide me over until I can get help from one of you heroes.

I'm really confused by this one. Normally fairly good at seeing issues like this but no-one's perfect eh ;)

I hope to have provided sufficient explanation but please hit me up for more if it will help. So, many thanks in advance.


p.s. I'm also using another script on the page also from DD, called motiongallery but since it worked perfectly together when in the beta folder, I don't understand how it can be that - never know though...

ddadmin
04-24-2009, 03:02 AM
Wow this one certainly got me going for a while. :) The problem it turns out seems to simply be that you've manually modified the script to include the '../beta/Scripts' prefix to all images shown by the script, resulting in the broken images:


var layerHTML=(imgelement[1])? '<a href="../beta/Scripts/'+imgelement[1]+'" target="'+imgelement[2]+'">\n' : '' //hyperlink slide?
layerHTML+='<img src="../beta/Scripts/'+imgelement[0]+'" style="border-width:0" />'

I'm not sure why you did that, but you should revert it back to the original code:


var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+'">\n' : '' //hyperlink slide?
layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0" />'

JeremyDolan
04-24-2009, 04:58 PM
Thanks so much!

I've no idea why that happened, I certainly don't remember changing the script to prefix the images with anything but well spotted.

I simply re-downloaded/uploaded simplegallery.js and it fixed it!

Thanks again, DDadmin. and thanks DD, you're the most useful javascript site I've seen and in contention for the best site period.