SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    controlling tabs in a browser window with javascript

    ok this ones a bit of a long shot. I have a gmail account and regularly use googletalk thats embedded in the gmail account. When you're in a conversation
    with someone with multiple tabs open the gmail tab flashes if someone messages you whilst your viewing another tab. So say im in a conversation with someone at gmail but have another tab
    open and im looking at a thread at sitepoint...the gmail tab flashes orange.

    Anyone know how to do things like this? Ive searched everywhere but cant find an answer!

    Thanks

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried calling window.focus() from the inactive tab?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Kravvitz,

    Aha i think thats a definite step in the right direction but ive been googling it for about an hour and all i can find is this:

    http://foobr.co.uk/2007/05/annoying_users_with_onblur/

    which doesnt really discuss window.focus with tabs specifiacally.

    So i was going to try and call window.focus from my script when the ajax gets a reponse from the server......could i literally just put window.focus at the beginning of the function that handles the ajax response?

  4. #4
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Go ahead and try it.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


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
  •