SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Nov 2005
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Adding image next to link

    If you look at the "shop by category" section of the link below, there are expandable menus displaying the categories. My problem is that the categories are links, so when one is selected, not only is it expanded but the page also reloads. How could I go about separating the bullet from the <li> and <a> elements so that when the bullet is clicked, it will expand the menu and if the actual name is selected, it will go to that category?

    http://www.urlgone.com/117880/

    I'd appreciate if someone could just point me in the right direction. Thanks.

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,789
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi,

    There is no real need for Kcup to be a link anyway because when js is disabled the menu is expanded by default. So you could use a span instead of an anchor and just style it to look the same.

    A quick fix would be just to remove the href destination.

    e.g.

    Code:
    <li class="submenu"><a href="#nogo">KCup</a>
    Now when clicked it will not go anywhere. The semantic solution though is to change that anchor to a more suitable element such as a span or perhaps a heading tag of the appropriate level might be more appropriate.

    There is probably a JS solution also in making the link when clicked returned false so that it doesn't follow but that's a question for the JS forum.


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
  •