Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question JavaScript Click and Focus Facebook status update text Box

    Hi,
    I am trying to implement something like a javascript that can click and focus the Status Update Box on Facebook. Till now, I have nothing in hand that can perform the task so I thought about a javascript that can do it.
    I am not even a newbie to javascript but I know that it can perform various complicated tasks on client side.
    Can anyone here tell me how do I click the Status Update box and set it to focused by a javascript so that when I start typing the Status box receive the text ?
    Thanks

  • #2
    Regular Coder Apothem's Avatar
    Join Date
    Mar 2008
    Posts
    380
    Thanks
    36
    Thanked 25 Times in 25 Posts
    I suggest you look into JS frameworks like jQuery, Prototype, etc.

    Though, I've only used jQuery. To focus on something, I would just do:
    $("#searchbox_id").focus()

    I am not sure how other frameworks work, but it is likely very similar.

  • #3
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Apothem View Post
    I suggest you look into JS frameworks like jQuery, Prototype, etc.

    Though, I've only used jQuery. To focus on something, I would just do:
    $("#searchbox_id").focus()

    I am not sure how other frameworks work, but it is likely very similar.
    Actually I tried many things before posting it here, I guess there are 2 or more elements playing a combined role in activating and focusing the textbaox on facebook page. it is a chain of 2-3 javascripts that finally activate the textbox upon a click on a div.
    I am totally lost in DIVs please help. can you have a look at the page and figure out what happens when you click on the the text box "What's on your Mind ?"
    Thank you for your reply.

  • #4
    Regular Coder Apothem's Avatar
    Join Date
    Mar 2008
    Posts
    380
    Thanks
    36
    Thanked 25 Times in 25 Posts
    Quote Originally Posted by Dragon Bird View Post
    Actually I tried many things before posting it here, I guess there are 2 or more elements playing a combined role in activating and focusing the textbaox on facebook page. it is a chain of 2-3 javascripts that finally activate the textbox upon a click on a div.
    I am totally lost in DIVs please help. can you have a look at the page and figure out what happens when you click on the the text box "What's on your Mind ?"
    Thank you for your reply.
    While I will not inspect the inner workings of Facebook, I will try to tell you what I think is happening.

    You are given a box. Let's give it an id, say, "mind".
    The "mind" box has a focus event AND a blur event.
    When this focus event is triggered, there is some code that adds some HTML related text after the "mind" box. More over, the "mind" box has been slightly enlarged. This is key. The main reason for why it does not re-enlarge or re-add code is because one does need to check if the rows/height is different from the original.
    - The color attribute of the "mind" box's CSS is then changed.
    When there is a blur (i.e. you click elsewhere), that same color attribute is changed back to its original value.


  •  

    Posting Permissions

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