GeekyG Posted February 14, 2008 Share Posted February 14, 2008 Hello, I am using a modified script of PHPSlideshow (http://www.zinkwazi.com/wp/scripts/) My modified version: http://www.multimedia-designs.com/V3/phpslideshow/test/projects/indie/indie_titan.php I got the layout and script to work the way I wanted it to (so I thought) and now I have ran into a new problem. Because the image slideshow is not at the top of the page, you have to scroll down in order to view the slideshow. The problem: every time an end-user clicks on an image, the page jumps back to the top of the browser. I think I know why it does, because the script is fetching the next image and reloading it, which brings the page back to the top. Is there a solution? Or am I wasting time. Can I prevent the page from jumping back to the top each time an image is clicked on? Thanks, I am definitely a PHP beginner, and all help is appreciated. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted February 14, 2008 Share Posted February 14, 2008 It jumps back because you simply load a new page. To overcome this, you can use javascript (AJAX) to load the pictures asynchronously, but then you have to use a completely different slideshow script (written in javascript). You should be able to find lots of examples on how to achieve this, though Quote Link to comment Share on other sites More sharing options...
GeekyG Posted February 14, 2008 Author Share Posted February 14, 2008 That's what I was afraid of, after all that work! I was looking for a server-side solution because of people who disable JavaScript. I guess now it is a toss-up between Flash or an Ajax (JavaScript) slideshow. Anyone have an opinion on this? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 14, 2008 Share Posted February 14, 2008 I'm a big fan of http://slideshowpro.net/ It's not free, but in my opinion, well worth the money Quote Link to comment Share on other sites More sharing options...
GeekyG Posted February 14, 2008 Author Share Posted February 14, 2008 Thanks. I'll look into it. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted February 14, 2008 Share Posted February 14, 2008 Well, I have an idea. You could keep your PHP, and use a HTML bookmark. Just put a name="something" in your anchor tag surrounding "start slideshow", and then put #something at the end of the links used to see the different images. It will then reload the page, and jump down to the "start slideshow" text. <a href="/V3/phpslideshow/test/projects/indie/indie_titan.php?directory=.&auto=1¤tPic=1" name="something">start slideshow</a> Quote Link to comment Share on other sites More sharing options...
GeekyG Posted February 14, 2008 Author Share Posted February 14, 2008 This is a pretty good idea. But the page would still be "jumping" all over the place; which to me, would look unprofessional. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted February 14, 2008 Share Posted February 14, 2008 Yeah, I see what you mean. I think I would go with the AJAX solution, since most people have javascript turned on. If you go for Flash, there's the free SimpleViewer, but I'm not sure if these kind of galleries (often fullscreen) would work as part of your portfolio. Quote Link to comment Share on other sites More sharing options...
haku Posted February 15, 2008 Share Posted February 15, 2008 There is no PHP solution around the jumping other than the one thebadbad posted. It will jump around as you say, but will bring the user back to the position in question everytime. The only way around this is to implement an AJAX solution as thebadbad mentioned. However, if you are going to implement an AJAX solution, you should use both. Set up the PHP solution, and then overlay the AJAX solution on top of this. This way, if your users have javascript turned off, it will still work for them, although it wont look as pretty as if they have javascript turned on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.