Form objects overlay div

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fabri

    #1

    Form objects overlay div

    Someone call please tell me why this simple code:

    =============== =============== =============== =============== =====
    <html>
    <head>
    <title>Exampl e</title>
    <style type="text/css">
    #msg{
    position: absolute;
    background-color: white;
    margin: auto;
    padding: 5px;
    border: 5px solid red;
    font: bolder 15px arial;
    }
    </style>
    </head>
    <body>
    <div id="msg">PippoP ippo</div>
    <form name="form1" method="post" action="">
    <select name="select">
    <option value="PippoPip po" selected>PippoP ippo</option>
    </select>
    </form>
    </body>
    </html>
    =============== =============== =============== =============== =====

    in IE and firefox work differently?

    I tried to use z-index properties but nothing change.

    In IE form objects "win".
    In FF div "win".

    How can I decide to show an element "over" another?

    Any help appreciated.

    Regards.

    --
    Fabri
    ("Sig. Finocchiaro, mi sa dire quali sono i Pirati più pericolosi?Si
    .....i piràti ndé baddi!")
  • cosmic fool

    #2
    Re: Form objects overlay div


    "Fabri" <no@sp.am> wrote in message news:d7pr9q$djn $1@news.ngi.it. ..[color=blue]
    > Someone call please tell me why this simple code:
    >
    > =============== =============== =============== =============== =====
    > <html>
    > <head>
    > <title>Exampl e</title>
    > <style type="text/css">
    > #msg{
    > position: absolute;
    > background-color: white;
    > margin: auto;
    > padding: 5px;
    > border: 5px solid red;
    > font: bolder 15px arial;
    > }
    > </style>
    > </head>
    > <body>
    > <div id="msg">PippoP ippo</div>
    > <form name="form1" method="post" action="">
    > <select name="select">
    > <option value="PippoPip po" selected>PippoP ippo</option>
    > </select>
    > </form>
    > </body>
    > </html>
    > =============== =============== =============== =============== =====
    >
    > in IE and firefox work differently?
    >
    > I tried to use z-index properties but nothing change.
    >
    > In IE form objects "win".
    > In FF div "win".
    >
    > How can I decide to show an element "over" another?
    >
    > Any help appreciated.
    >
    > Regards.
    >
    > --
    > Fabri
    > ("Sig. Finocchiaro, mi sa dire quali sono i Pirati più pericolosi?Si
    > ....i piràti ndé baddi!")[/color]


    i think that may be because ie kind of sucks.
    try setting the select's visibility to hidden


    Comment

    • Grant Wagner

      #3
      Re: Form objects overlay div

      "cosmic fool" <sit@onit.com > wrote in message
      news:Hq_ne.1281 5$yG4.1009604@n ews20.bellgloba l.com...[color=blue]
      >
      > "Fabri" <no@sp.am> wrote in message news:d7pr9q$djn $1@news.ngi.it. ..[color=green]
      >> How can I decide to show an element "over" another?
      >>
      >> Any help appreciated.[/color]
      >
      > i think that may be because ie kind of sucks.
      > try setting the select's visibility to hidden[/color]

      "ie kind of sucks" is not a particularly useful explanation.

      A more useful explanation might be: In IE version 5 and higher, <select>
      is a windowed element. As explained at <url:
      http://support.microsoft.com/default...b;en-us;177378 />:

      "All windowed elements paint themselves on top of all windowless
      elements, despite the wishes of their container."

      You'll have to try to figure out when elements are overlapping the
      <select> and hide the <select> under those circumstances. If you know
      that the display of the <div> and the <select> are mutually exclusive,
      and the <div> only appears under very specific circumstances, you could
      try just hiding the <select> anytime the <div> is visible. It really
      depends on your requirements.

      --
      Grant Wagner <gwagner@agrico reunited.com>
      comp.lang.javas cript FAQ - http://jibbering.com/faq


      Comment

      • cosmic fool

        #4
        Re: Form objects overlay div


        "Grant Wagner" <gwagner@agrico reunited.com> wrote in message
        news:uH%oe.365$ 3d3.1883@news2. mts.net...[color=blue]
        > "cosmic fool" <sit@onit.com > wrote in message
        > news:Hq_ne.1281 5$yG4.1009604@n ews20.bellgloba l.com...[color=green]
        > >
        > > "Fabri" <no@sp.am> wrote in message news:d7pr9q$djn $1@news.ngi.it. ..[color=darkred]
        > >> How can I decide to show an element "over" another?
        > >>
        > >> Any help appreciated.[/color]
        > >
        > > i think that may be because ie kind of sucks.
        > > try setting the select's visibility to hidden[/color]
        >
        > "ie kind of sucks" is not a particularly useful explanation.
        >
        > A more useful explanation might be: In IE version 5 and higher, <select>
        > is a windowed element. As explained at <url:
        > http://support.microsoft.com/default...b;en-us;177378 />:
        >
        > "All windowed elements paint themselves on top of all windowless
        > elements, despite the wishes of their container."
        >
        > You'll have to try to figure out when elements are overlapping the
        > <select> and hide the <select> under those circumstances. If you know
        > that the display of the <div> and the <select> are mutually exclusive,
        > and the <div> only appears under very specific circumstances, you could
        > try just hiding the <select> anytime the <div> is visible. It really
        > depends on your requirements.
        >
        > --
        > Grant Wagner <gwagner@agrico reunited.com>
        > comp.lang.javas cript FAQ - http://jibbering.com/faq
        >
        >[/color]

        lol
        like i said, it sucks


        Comment

        • drWot

          #5
          Re: Form objects overlay div

          You can cry about the Microsoft behavior or work around it:

          It is possible to have a select element on your page and still overlay the
          page with other content; even in browsers that try to keep the select on
          top.

          You have to hide the select element; but to have easy access to it, hide it
          under a 'faux select' element that can be overlaid.

          Clicking the fake 'select' toggles the select display.

          Like this:

          1. Create a span element

          2. Put the select element in the span and set the select element's display
          property to 'none' ;

          3. Create a span with the text from the selected option as its content and
          append it to the parent span;
          (To really look like a select element give this inner span a little
          gif of the drop down arrow beside the text)

          4 Set an onclick event handler on the parent span that:
          swaps the display of the select element to 'inline' and the
          visibility of the inner span to 'hidden';
          calls focus() on the select element (to show the drop down list)
          (to avoid having to click twice to see the option list you need to
          set the select's multiple attribute to true.
          if that can be a problem in your code, set the select size attribute
          to false);

          5. Set the select element's onchange event to do whatever it is supposed to
          do;
          plus change the text in the inner span to match the selected option text

          6.Set an onblur event handler (in case someone leaves the select without
          selecting anything)that:
          resets the display of the select to 'none';
          resets the visibility of the inner span to 'visible';

          To a visitor it looks like a select element, but it will not push itself
          above an overlay.

          If you have to do it more than once, write a function to 'encapsulate' any
          select element.





          Comment

          • RobB

            #6
            Re: Form objects overlay div



            Fabri wrote:[color=blue]
            > Someone call please tell me why this simple code:
            >
            > =============== =============== =============== =============== =====
            > <html>
            > <head>
            > <title>Exampl e</title>
            > <style type="text/css">
            > #msg{
            > position: absolute;
            > background-color: white;
            > margin: auto;
            > padding: 5px;
            > border: 5px solid red;
            > font: bolder 15px arial;
            > }
            > </style>
            > </head>
            > <body>
            > <div id="msg">PippoP ippo</div>
            > <form name="form1" method="post" action="">
            > <select name="select">
            > <option value="PippoPip po" selected>PippoP ippo</option>
            > </select>
            > </form>
            > </body>
            > </html>
            > =============== =============== =============== =============== =====
            >
            > in IE and firefox work differently?
            >
            > I tried to use z-index properties but nothing change.
            >
            > In IE form objects "win".
            > In FF div "win".
            >
            > How can I decide to show an element "over" another?
            >
            > Any help appreciated.
            >
            > Regards.
            >
            > --
            > Fabri
            > ("Sig. Finocchiaro, mi sa dire quali sono i Pirati più pericolosi?Si
            > ....i piràti ndé baddi!")[/color]

            This one's been blogged to death....

            google "iframe shim" for suggestions. #:=)

            Comment

            Working...