Re: menu mouseover using php and javascript
| From: | web_singer | Date: | Wed, 22 Sep 2004 21:02:23 +0000 |
| Subject: | Re: menu mouseover using php and javascript | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197624@lists.php.net to get a copy of this message | ||
"John Nichel" <john@kegworks.com> wrote in message
news:4151E1A1.60503@kegworks.com...
> 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
Thanks for the response, I am very new to using PHP (really need a newbies
section LOL) and while I can see how a multi-dimensional array would have
been better than using two I am not sure how I would get my code to read
that text in the mouseover. I can read the two arrays but cannot seem to
tell the code that the variable i am passing in the mouseover is the object
and not the text i want to display.
Hope that you can help :)
WebSinger
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.767 / Virus Database: 514 - Release Date: 09/21/2004