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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Onmouseover change text width?

    Is it possible, to change the width of a textbox on the mouseover control? For example, if the default size of the textbox is 104px, is it possible to change the width to say 184 onmouseover? If so, what is the code? Thanks you.

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    Yes it is possible.

    here is an example.

    <input type="text" onmouseover="javascript: this.style.width='180px';">

    You can do the same thing for onmouseout so you can re-instantiate the width to its original value.

    By the way, it might be better to defines a couple of CSS class for original width and another for for the onmouseover effect. if you do that, you can then say onmouseover="javascript: this.style.className='class_name_here'"

    good luck

  • #3
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you so much! I'm quite new to javascript so yeah, I don't really know much. But thank you so much!


  •  

    Posting Permissions

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