onclick‘s and ‘
For work we wanted a way of showing images as a funky slideshow, the slideshow however needed to change the URL for each image and have the ability for the user to either manually alter the URL to go to an image, use the browser’s back button and bookmark an image. The user should choose when to move to another image so in the previously mentioned situations and when next or previous is clicked the images should fade into the next.
In true 2.0 style I have a ‘beta‘ version up and running, its not yet there but its a start. The next and previous links work and fade nicely, the back button really does work (even with the fade) as does the ability to change the URL manually. All images used are ones I have taken and are licensed under the creative commons.
The final version will:
- Fix all the bugs – so the style ‘issues’, (mainly in IE) there is a flash of the previous image in Safari and some nightmarish debugging is needed for the ‘Permission denied’ error I am getting in IE6! (You may have already guessed that I unashamedly developed this in FireFox.)
- Fix the performance problem – I really don’t know why this occurs but if you click through a number of images by the time you get to 6 or 7 the performance lag is very noticeable. Currently, I am changing the URL with fragment ID’s from the
location.hashproperty and updating the
location.hrefwith the id of the current image. Listening to the URL is done through a function on
setInterval()on 500ms that checks against one of the few global variables if the location.hash has changed. I’m thinking of changing this to use
setTimeout()instead so I can stop it during the fade and start up again straight after, this might work.
- Have ‘further information’ links – per image that then changes (not necessarily fades) as the images do
- Use image maps - As this was the original intention of the slideshow, to work with images that are image maps, I am really hoping that this is going to be a nice easy stage; I have yet to try setting the opacity on image maps.
- Stress test it! - The fun part, its the fixing afterward that might not be quite such a laugh.
Feel free to view my efforts: