This is a discussion on "[SOLVED] Javascript/PHP Image Rotator" within the PHP Forum section. This forum, and the thread "[SOLVED] Javascript/PHP Image Rotator are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Javascript/PHP Image Rotator
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] Javascript/PHP Image Rotator
I have the following code to rotate images and a corresponding caption:
If this is too complicated, don't bother trying. Otherwise, I'm interested. Thanks, SWagner
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
|
|
#2
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
It most certainly is and I'm willing to bet that it's much faster doing this server-side....
Check out the PHP image functions.
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#3
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
Do you mean that it is too complicated or that there is a way of doing it?
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Last edited by Stuart; Oct 15th, 2007 at 11:49. |
|
#4
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
I have used this one in the past - Simple PHP randomizer - I'm sure you could easily integrate some caption from this code.
hth |
|
#5
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
No, it's not complicated and yes, I'm sure there is a way of doing it. I've just never done much myself with the image functions so I can't tell you exactly how.
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#6
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
Quote:
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
#7
|
||||
|
||||
|
Re: Javascript/PHP Image Rotator
From what I can see, you would not have to use image functions at all.
It's just a matter of loading a different each time? If that's the case, a function like the one I whipped up below should work
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#8
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
Oh, I thought you meant rotate as in "turn the images 90 degrees"....
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#9
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
No, sorry. I meant "rotate" as in change when body loads. Rakuli's code looks good. I'll try it...
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
#10
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
Rakuli,
Thanks for the code. There is just one problem. The following appears on my page:
Any idea why this happens?
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
#11
|
||||
|
||||
|
Re: Javascript/PHP Image Rotator
Can you show the preceding code because it means a statement has not been ended correctly in the code above it.
Thanks
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#12
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
Actually, the problem sort of fixed itself (not occurring anymore). But now, there is another small issue - the image is not being displayed...
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
#13
|
||||
|
||||
|
Re: Javascript/PHP Image Rotator
Did you call the function and echo it to your page?
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#14
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
Do you mean the examples you gave me within the comments?
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
#15
|
||||
|
||||
|
Re: Javascript/PHP Image Rotator
Yes, if you have changed the code you would need to echo the equivalent
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#16
|
|||
|
|||
|
Re: Javascript/PHP Image Rotator
I used pretty much the exact code you gave me, of course adding the other images and changing the image sources, heights, widths, and captions...
PS: If I add images, do I need to put a number in the []s after $images?
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|