Re: menu mouseover using php and javascript
| From: | John Nichel | Date: | Wed, 22 Sep 2004 20:33:37 +0000 |
| Subject: | Re: menu mouseover using php and javascript | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197616@lists.php.net to get a copy of this message | ||
web_singer wrote:
I am using an array to create a menu and the code to change an image on mouseover. I would also like to change some text on mouseover. While i can do it using a swtich in javascript it requires that I hard code all the different options in. My whole reason for using the php in the first place was to avoid having to hard code anything at all. Does anyone have an idea how I can get the text portion to also use my variable? This is what i have so far... <? $site_pages = array("pageone", "pagetwo", "pagethree" ); $site_text = array("this is text one", "this is text two", "this is text three" ); <snip>Why not just use a multi-dimensional array? $site = array ( 1 => array ( "page" => "pageone", "text" => "this is text one" ), 2 => array ( "page" => "pagetwo", "text" => "this is text two" ), so-on, and so-forth... ) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com