Is PHP up to task?
| From: | René Fournier | Date: | Sat, 15 Dec 2001 00:27:33 +0000 |
| Subject: | Is PHP up to task? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-77794@lists.php.net to get a copy of this message | ||
(Now that I have your attention... :-)
Here's the situation: All the navigational buttons in the site I'm working on have three different states (for mousovers--normal, mouseover, onClick). What I don't like: When I mouse over one button, it takes a second or two for the page to fetch the mouseover state of the button from the server. Now, normally, I would just write a preloadimages() function in JavaScript and preload all the button states when the pages load. BUT, this is a little harder, since this is a fairly big site (or will be) and it's not always the same buttons that need to be loaded; they can change from page to page (say, between sections, with subnav bars). That being said, I've kept one thing simple: All the buttons (and their states) are stored in the same directory, and in fact only button images are in that directory ("/nav").
So here's what I would like to know: Is it possible for PHP to read the contents of a directory--all the files--and then take that array and generate some javascript preload() statements? (Of course, I'm sure it IS possible, but I would appreciate any pointers you might have before I undertake it. Maybe there's even a better way than what I can see!) What I was thinking was to preload all the nav buttons and their states in the header.inc.
Thanks.
...Rene
---
René Fournier
renefournier@yahoo.com