|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
macrumors 68020
Join Date: Oct 2006
|
dynamic text on main page
Hi all. I tried searching, but had trouble finding something relevant. How would I go about having different quotations (4-5) rotate which one is displayed on the main page of a site when it is loaded. The lower the language the better, is this possible with HTML/CSS? Any help would be greatly appreciated.
__________________
Mac Pro 8 core 2.8Ghz, 8800GT, 8GB RAM, 1.3TB MBP 15" 2.4Ghz Glossy:4GB RAM,160GB 7200RPM HDD Nikon D90: 70-300mm VR, 18-105mm VR, 50mm 1.8 |
|
|
|
| aaronw1986 |
| View Public Profile |
| Find More Posts by aaronw1986 |
|
|
#2 |
|
macrumors regular
Join Date: Feb 2009
|
PHP out of the question ? or JavaScript ?
You could store the key of the last quotation displayed to the user in their cookie, or session details, and modify it every time they load the page. |
|
|
|
|
|
#3 |
|
macrumors 65816
Join Date: Oct 2007
|
|
|
|
|
| Darth.Titan |
| View Public Profile |
| Find More Posts by Darth.Titan |
|
|
#4 |
|
macrumors 601
Join Date: Aug 2005
Location: Ohio
|
Can't be done with HTML/CSS alone as they are not dynamic. You could use JavaScript or PHP. JavaScript is the lower of the levels, but requiring it will mean visitors who have JavaScript disabled (like me) won't see the quote, unless you have a default one in place. PHP would be seen by everyone though.
Here's the quick and dirty though in JavaScript. The same idea can be used in PHP if you want. PHP Code:
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|