SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: drop down menu

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    pt
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    drop down menu

    Hi.

    I'm trying to make a drop down menu like the one here :

    http://www.europcar.co.uk/tools/fram...ute=00&x=8&y=7

    In the "Vehicle Category" the image of the car changes whenever another option is selected....how to do this?

    Thanks

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Assume you're aware that a web page allows you to "view source (code)".

    HTML
    Code:
    <select class="control" name="reservation.carclass" size=1  tabindex="1" onChange="modifyCarImage(this)">
    <option  value="M">Mini</option>
    <option  value="E">Economy</option>
    <option selected value="C">Compact</option>
    <option  value="I">Intermediate</option>
    .............
    <img alt="" name="CarImage" src="/images/ans/M.jpg" border="0" align="absmiddle">
    JS
    Code:
    function modifyCarImage(select){
    		switch(select.value) {
    			case "M":
    				document.CarImage.src = "/images/ans/M.jpg";
    				break;
    			case "E":
    				document.CarImage.src = "/images/ans/E.jpg";
    				break;
    			case "C":
    				document.CarImage.src = "/images/ans/C.jpg";
    				break;
    			case "I":
    .......etc.
    Last edited by adios; Jul 2, 2004 at 09:04.
    ::: certified wild guess :::

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    pt
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THanks adios :-)

    I'm trying to put it together now.
    How can you view source from the frameset?

    thanks again.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    pt
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it to work :-)))

    Thanks


  5. #5
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just right-click over the area you're interested in (Mozilla will give you a context-specific frame menu). If that doesn't work, just use View>Source on the main toolbar, look at the various frame urls in the main <frameset> document, choose & copy a likely suspect, and tack it on to the base url in the address bar. To find the relevant code quickly, do a find on some displayed word(s) - like "Mini" (above).
    ::: certified wild guess :::

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    pt
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks again adios.
    Im a newbie in php but don't know really nothing about javascript.
    Im seeing javascript is really a powerfull stuff.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •