SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist mumford1's Avatar
    Join Date
    Sep 2002
    Location
    UK
    Posts
    573
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Change bground colour of div on mouse click

    Hi

    Could someone look at my navigation at http://www.search-engine-professionals.co.uk, at the moment the div bground changes colour to black on mouse-over.

    What i want to happen is when the user clicks on one of the menu items it stays black until another item has been clicked.

    does anyone have any ideas?

    thanks for any help

  2. #2
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Location
    Wellington, New Zealand
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Write a small script to pre-process the onClick function for the div.

    So long as whatever you put in that function returns true the link will still operate as normal.

    Very interesting - I didn't know that the :hover etc classes could be applied to DIV's.
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel

  3. #3
    SitePoint Evangelist mumford1's Avatar
    Join Date
    Sep 2002
    Location
    UK
    Posts
    573
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ive just seen the link sorry there is a fullstop at the end it should be http://www.search-engine-professionals.co.uk

  4. #4
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You must be talking about the navigation bar. If somebody is on 'home' you want this field to remain black until the person goes somewhere else, right?

    I am sure i've seen that before somewhere, not sure though whether it was CSS though.

    However, i've seen a similar CSS where when you're stuck on one page an ever so slight border is added to the right of the link... i'll try to find that page and will post the link.

    Edit:


    actuallt check out the top navigation bar of www.rtl.lu, if they manage to give it 5 different colours (each related to the colour scheme of the correspondent page) you should be able to do this with the one colour only too...
    Last edited by Lister14; Dec 11, 2002 at 05:22.
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!

  5. #5
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    havn't tried this yet but looks promising:

    a.link:active {...}
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!


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
  •