SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    3 Post(s)
    0 Thread(s)

    How do I refresh page and keep a dropdown menu open


    I'm trying to achieve a notification feature which you see on facebook, myspace and so on.

    Here the trick that I use:
    I've pulled a number of data that a user has not been read (where active ='0') from a database to display on a notification icon on the menubar -- the exact notification icon you will see on facebook and myspace -- says 2 unread messages in bright red.

    As the user click on the notification button to open up a dropdown menu and read their unread messages I process the script and update the active = '0' to active = '1' and refresh the page.

    The problem is when the page is refreshed, the dropdown menu and the notification both disappeared.

    How do I remove only that number in red and keep the dropdown menu open, I know that both facebook and myspace didn't even refresh a page.

    In this case, I don't even know whether I use javascript or ajax. I've stolen (borrowed) the feature from twitter.

    Hope I explain what I'm trying to do clearly and thanks for your help

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2011
    South Africa
    0 Post(s)
    0 Thread(s)
    it sounds like you are going to have to use ajax, so you won't need to have the page refreshed,
    and javascript should offer a solution to the dropdown menu problem,
    or maybe instead of using a dropdown menu you could try and build a similar control using a div as your container.
    Last edited by ulricht609; Sep 8, 2011 at 11:42. Reason: add. txt


Posting Permissions

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