SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Guru tictike's Avatar
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    863
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    select list navigation without js

    I have some navigation like:

    Code HTML4Strict:
    <select>
    	<option>text</option>
    	<option value="#">link text</option>
    	<option value="#">link text</option>
    	....
    </select>

    Right now js opens the URL in the value attribute, but I want users to be able to navigate if js is turned off. Is that possible using this markup?

  2. #2
    SitePoint Addict
    Join Date
    Dec 2007
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe you can replace them with <a ...>...</a> tags but then you will need a complex CSS solution to create select-like functionality. Anyway, it may be something like CSS-only menu: http://google.com/search?q=css+menu
    I'm creating trouble-free Apache, PHP, MySQL installer, WITSuite,
    and use it to setup my development environment.
    Demo, support, contact. Questions?

  3. #3
    SitePoint Guru tictike's Avatar
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    863
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That might be a good idea.. I'm pretty sure anchors cannot be used in option elements but I wasn't 100&#37; sure..

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, you cannot. An option element can only contain text (#PCDATA); no markup.

    I think that what alex.w747 meant was that you could replace the entire select element with a list of links and style it to look similar to a select. You'd still need JavaScript, though, if you want it to work in IE6 and other ancient browsers that don't have full support for the :hover pseudo-class.
    Birnam wood is come to Dunsinane


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
  •