SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2001
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make browserwindow 'flash' in windows menu bar ?

    I'm working on a kind of instant-messaging option on my website. I would like to have the effect of the browser of my user to 'flash' in his menubar, when he recieves a notification that requires his attention. This should not be an additional popup or anything else annoying, and it should only happen when the user's browser (that has my site open) is not active.

    I know it's possible as I have seen it before. But I can not easily describe it, so therefore can not really google it either. Is this a javascript or css thing ? I have no idea, but any tips are welcome. Thanks

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,712
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    When you use an alert for when the notification requires the users attention, that will flash the toolbar button for the browser.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    hmm
    what you are describing reminds me of something I heard called the earthquake effect using javascript

    check here if this is what you want

    if not then you may want to check out dynamicdrive.com 's document effects section as they have a lot of cool scripts to do things to the document, viewport window, etc
    Last edited by paul_wilkins; Jun 21, 2010 at 12:42.

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,712
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by team1504 View Post
    hmm
    what you are describing reminds me of something I heard called the earthquake effect using javascript
    That earthquake effect affects the browser page, but the OP is wanting the taskbar button to attract the users attention instead, for when the browser is not visible.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,826
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    It isn't something that can be done from within the web page using CSS or JavaScript.

    It might be something that can be done using a plugin or extension added to the browser. You'd definitely need to have something trigger a reload of the page in order to provide something to detect.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,712
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by felgall View Post
    It isn't something that can be done from within the web page using CSS or JavaScript.
    It appears though that showing a dialog box will achieve the desired result.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #7
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    ahh hmmm

    yeah a dialogue box works for me

    However, the dialogue box was triggered after a certain time of viewing the page so I had some time to minimise my browser. Because i believe the os or browser won't cause the flashing notification if the user is in said window.

    I dont know if it will work on the dock for mac. But for mac it would cause the browser's icon to bounce.

    One thing that felgall might have been referring too, sorry if im speaking for you, here:
    It isn't something that can be done from within the web page using CSS or JavaScript.
    is that it may not work in every browser. Try safari, firefox, and (i just tried it in IE and it works)

    wow saying I tried it in IE and it works feels weird because usually speciifc configurations have to be made for IE

    Anywho, I hope I was of help. Ill post if I find anything

    Regards,
    Team 1504

    Edit: Just wondering I believe OP means the user with the original question, but what does it stand for?
    Last edited by team1504; Jun 21, 2010 at 14:43. Reason: What does OP mean

  8. #8
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,712
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    It works in IE and Firefox, Google Chrome though actually brings the browser window to the front, which would be really annoying if you're typing a space, that clears the alert box without having read what it had to say.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  9. #9
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    okay. if the op wants to make sure then i would recommend that odoisc try it in safari and opera as well.
    But from experience i learned that if it works in chrome, firefox, and IE it should be fine-- usually.

    really annoying if you're typing and typing a space clears the alert box without having read what it said.
    Yes that would be quite annoying especially if it was something important and if the OP's client requested it then it should be visible until the user purposely requests its departure.

    Here is an idea, maybe one could add buttons in the box that when the user gives input or clicks a certain button it would close the alert. The notification in the taskbar would turn off the moment the user reaches said window.
    A window-close button, a circle with an X in it should suffice...

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,826
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    You don't get any choice of what is in a dialog box generated by the browser. That is fully under the browser control.

    The Opera browser generates all dialogs inside the web page just the same as is now commonly used for any modal boxes the page needs to create and so it probably wouldnt cause the flash that is wanted. Also all Opera dialogs contain an option to turn off JavaScript.

    The only cross browser way to generate the wanted flash is to force a page reload.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •