Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
simple image slideshow not working in php
Old 08-05-2010, 06:06 AM simple image slideshow not working in php
Webmaster Talker

Posts: 611
Trades: 0
Hi, I'm trying to make a simple slideshow with forward and back buttons that change the image inside a div in php. When I press the "further" button, it jumps from index[0] to index[1] and never shows the first image. Then when I click more it doesn't go forward. When I click back, it goes back to a black screen div. Any help getting this to work is GREATLY appreciated because I've been trying for 2 days with tutorials and can't get it. Thanks. Derek

Here are the php parts that are relevant, my page was too large and confusing to include.

first, the $background array where I store my images.

Code:
$background = array
(
"<img src='sundragon_environments/ocean/ocean1_FRAME.jpg'/>",
"<img src='sundragon_environments/ocean/ocean1_FRAME2.jpg'/>"
);
then the code to move the images forward and backwards if the buttons are pressed.

Code:
then the code to move the images forward and backwards if the buttons are pressed.

and now to echo out the images inside the div.

Code:
<div id="background"><?php echo $currentBackground;?></div>
silverglade is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-05-2010, 08:41 AM Re: simple image slideshow not working in php
phpdasan's Avatar
Experienced Talker

Posts: 37
Name: Karthick B
Trades: 0
Hi,
You have not mentioned any java script here so i assume that your trying to achieve this using purely PHP. In my opinion this can't be possible without JavaScript(Please correct me if i am wrong). You may use ajax for this if you don't want to load all the data from the server at once.

OR
Transfer the PHP array to a JavaScript array and use the JavaScript array to navigate to and forth.

You may have a look at this

phpimagegallery.com
__________________
There is no secret ingredient.
phpdasan is offline
Reply With Quote
View Public Profile
 
Old 08-05-2010, 09:27 AM Re: simple image slideshow not working in php
Webmaster Talker

Posts: 611
Trades: 0
Thanks very much for that. Actually I'm using the flipping images for backgrounds in a role playing game I'm making. So the backgrounds have to change within the div. But thanks for the link.
silverglade is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to simple image slideshow not working in php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12253 seconds with 12 queries