SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Location
    Bangladesh
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question jQuery : add a border of an element

    Hi Everybody,

    Hope everybody is well with all..

    Can anyone help me about the following issue...

    ...I have an element (for example <div>) that i displayed in my browser is overflowed and overflow is hidden.

    Now after displaying browser when I move my mouse over to it, I want to add a border to the <div> using jQuery
    Code:
    .css("border","2px solid red").
    But the problem is::: at left side and top side border is added but at bottom and right border not added since these 2 sides overflowed.

    how can I add the border at all 4 sides?

    Thanksssssssssssssss... for seeing my post..

    Rashed

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,195
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Why not just use CSS for this? Anyway, I would put a border on the unhovered state too, either the same color as the background or transparent, and resize the div to accommodate that extra border. Then on hover (div:hover in the CSS) just change the color.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Location
    Bangladesh
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [QUOTE=ralph.m;4672412] resize the div to accommodate that extra border. QUOTE]

    How can I resize the div? It is already sized and overflow is hidden...

    Here is the situation: http://amerimav.com/amerimav/rashidul/google2/


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
  •