SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    hiding <select> in IE/Win: iframe or CSS?

    In IE 5.5+ (not sure about IE7), when an absolutely positioned element intersects with a <select>, the <select> shows through it regardless of the element's superior z-index.

    Apparently a solution seems to be to use an iframe as outlined here. This seems like a rather unpleasant solution, but the other solution is no nicer: simply hide (using display/visibility) the <select>s with javascript when the element is going to intersect over the <select>. One major drawback is that by hiding the selects you can make the user think your page is 'buggy'.

    Which would you use? What do you think the drawbacks for each method are (particularly the iframe one)?

  2. #2
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE7 doesn't do that.

  3. #3
    SitePoint Member
    Join Date
    Jan 2007
    Location
    Cologne, Germany
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In Firefox, when you position an input field or textarea over an iframe, the blinking | (caret) is hidden

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Opera 8.5 and earlier have the same problem with iframes as IE6 and earlier have with selects so if you replace the select with an iframe you just swap the browser that has the problem without fixing the problem.
    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="^$">

  5. #5
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies. That's good about IE7 I suppose, bummer about Opera 8.5. Funny though, I find Opera 9 to be much buggier in general.

    I think I'll just go with hiding the selects.

  6. #6
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The standard solution for the select is to set its visibility (or the form or element that contains it) to "hidden" when you don't want it to be visible.

  7. #7
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Cheers, that's what I'm doing.


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
  •