Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Tricky!!! Layoutproblem with JS generated select element

Tricky!!! Layoutproblem with JS generated select element

Scheduled Pinned Locked Moved Web Development
javascripthtmlquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stephan Pilz
    wrote on last edited by
    #1

    Hello, I generate with JS some HTML-Elements (Div, Hidden and Select) inside a Span-Tag. The Span is positioned absolut with JS after pressing a button. Now I see the Select-Element correct filled, but a static HTML-select-element of this page is displayed OVER the dynamic generated select. See Screenshot: www.stephan-pilz.de/1.jpg After I resize the window (manual with mouse !!!) in vertical direction, my dynamic select is displayed OVER the static (this is what I want). See screenshot: www.stephan-pilz.de/2.jpg Did anybody know, why the static select is displayed OVER the dyn. select? Or has anybody some ideas, how I can resize this window and back, to do the manual proc. with JS. For this case, I have try many things with window.resizeTo, .resizeBy, document.body.clientWidth and so on. Nothing of this works. PLEASE NOTE: The code must only work in IE and the window contains an frameset!!! Many thanks. :rose: I'm hopelessly. :confused: Stephan

                   \\\\\\|///
                 \\\\  - -  //
                  (  @ @  )
    

    +---------------oOOo-(_)-oOOo-----------------+
    | Stephan Pilz stephan.pilz@stephan-pilz.de |
    | www.stephan-pilz.de |
    | ICQ#: 127823481 |
    +-----------------------Oooo------------------+
    oooO ( )
    ( ) ) /
    \ ( (_/
    \_)

    G P 2 Replies Last reply
    0
    • S Stephan Pilz

      Hello, I generate with JS some HTML-Elements (Div, Hidden and Select) inside a Span-Tag. The Span is positioned absolut with JS after pressing a button. Now I see the Select-Element correct filled, but a static HTML-select-element of this page is displayed OVER the dynamic generated select. See Screenshot: www.stephan-pilz.de/1.jpg After I resize the window (manual with mouse !!!) in vertical direction, my dynamic select is displayed OVER the static (this is what I want). See screenshot: www.stephan-pilz.de/2.jpg Did anybody know, why the static select is displayed OVER the dyn. select? Or has anybody some ideas, how I can resize this window and back, to do the manual proc. with JS. For this case, I have try many things with window.resizeTo, .resizeBy, document.body.clientWidth and so on. Nothing of this works. PLEASE NOTE: The code must only work in IE and the window contains an frameset!!! Many thanks. :rose: I'm hopelessly. :confused: Stephan

                     \\\\\\|///
                   \\\\  - -  //
                    (  @ @  )
      

      +---------------oOOo-(_)-oOOo-----------------+
      | Stephan Pilz stephan.pilz@stephan-pilz.de |
      | www.stephan-pilz.de |
      | ICQ#: 127823481 |
      +-----------------------Oooo------------------+
      oooO ( )
      ( ) ) /
      \ ( (_/
      \_)

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You could try by specifying the z-index of the elements, but I'm not sure how well the select elements would respond to that. IE 6 is using a standard Windows control for the select list, so it doesn't play very well with other elements in the browser. I would suggest that you change the layout so that you won't have select elemenents on top of each other.

      --- b { font-weight: normal; }

      S 1 Reply Last reply
      0
      • G Guffa

        You could try by specifying the z-index of the elements, but I'm not sure how well the select elements would respond to that. IE 6 is using a standard Windows control for the select list, so it doesn't play very well with other elements in the browser. I would suggest that you change the layout so that you won't have select elemenents on top of each other.

        --- b { font-weight: normal; }

        S Offline
        S Offline
        Stephan Pilz
        wrote on last edited by
        #3

        Hm. Not bad idea with the z-Index. Did you know, how I can change that? It's is unfortunately not possible to change the static elements in the page. Stephan

                       \\\\\\|///
                     \\\\  - -  //
                      (  @ @  )
        

        +---------------oOOo-(_)-oOOo-----------------+
        | Stephan Pilz stephan.pilz@stephan-pilz.de |
        | www.stephan-pilz.de |
        | ICQ#: 127823481 |
        +-----------------------Oooo------------------+
        oooO ( )
        ( ) ) /
        \ ( (_/
        \_)

        S 1 Reply Last reply
        0
        • S Stephan Pilz

          Hm. Not bad idea with the z-Index. Did you know, how I can change that? It's is unfortunately not possible to change the static elements in the page. Stephan

                         \\\\\\|///
                       \\\\  - -  //
                        (  @ @  )
          

          +---------------oOOo-(_)-oOOo-----------------+
          | Stephan Pilz stephan.pilz@stephan-pilz.de |
          | www.stephan-pilz.de |
          | ICQ#: 127823481 |
          +-----------------------Oooo------------------+
          oooO ( )
          ( ) ) /
          \ ( (_/
          \_)

          S Offline
          S Offline
          Stephan Pilz
          wrote on last edited by
          #4

          Now I tried to set the z-order via .style.zIndex to 999 of my dyn. select and to 0 of the static select. That does not solve the problem. Any other ideas ? Thanks Stephan

                         \\\\\\|///
                       \\\\  - -  //
                        (  @ @  )
          

          +---------------oOOo-(_)-oOOo-----------------+
          | Stephan Pilz stephan.pilz@stephan-pilz.de |
          | www.stephan-pilz.de |
          | ICQ#: 127823481 |
          +-----------------------Oooo------------------+
          oooO ( )
          ( ) ) /
          \ ( (_/
          \_)

          1 Reply Last reply
          0
          • S Stephan Pilz

            Hello, I generate with JS some HTML-Elements (Div, Hidden and Select) inside a Span-Tag. The Span is positioned absolut with JS after pressing a button. Now I see the Select-Element correct filled, but a static HTML-select-element of this page is displayed OVER the dynamic generated select. See Screenshot: www.stephan-pilz.de/1.jpg After I resize the window (manual with mouse !!!) in vertical direction, my dynamic select is displayed OVER the static (this is what I want). See screenshot: www.stephan-pilz.de/2.jpg Did anybody know, why the static select is displayed OVER the dyn. select? Or has anybody some ideas, how I can resize this window and back, to do the manual proc. with JS. For this case, I have try many things with window.resizeTo, .resizeBy, document.body.clientWidth and so on. Nothing of this works. PLEASE NOTE: The code must only work in IE and the window contains an frameset!!! Many thanks. :rose: I'm hopelessly. :confused: Stephan

                           \\\\\\|///
                         \\\\  - -  //
                          (  @ @  )
            

            +---------------oOOo-(_)-oOOo-----------------+
            | Stephan Pilz stephan.pilz@stephan-pilz.de |
            | www.stephan-pilz.de |
            | ICQ#: 127823481 |
            +-----------------------Oooo------------------+
            oooO ( )
            ( ) ) /
            \ ( (_/
            \_)

            P Offline
            P Offline
            Paddy Boyd
            wrote on last edited by
            #5

            The select is displayed over because the listboxes generated by the browser do not take z-order styles - i think it's something to do with them actually being windows controls (vague memory...). Anyway, there is a workaround - if you want to put something over a listbox (we had this problem with dynamically created dropdown menus), you can create an iframe the same size as whatever you want to go over your listbox and one z-order underneath it (i've heard the term shim for this). The iframe hides the select box. So if you could look at your page in height it'd be like this:

            div to display
            iframe
            select to hide
            PAGE

            S 1 Reply Last reply
            0
            • P Paddy Boyd

              The select is displayed over because the listboxes generated by the browser do not take z-order styles - i think it's something to do with them actually being windows controls (vague memory...). Anyway, there is a workaround - if you want to put something over a listbox (we had this problem with dynamically created dropdown menus), you can create an iframe the same size as whatever you want to go over your listbox and one z-order underneath it (i've heard the term shim for this). The iframe hides the select box. So if you could look at your page in height it'd be like this:

              div to display
              iframe
              select to hide
              PAGE

              S Offline
              S Offline
              Stephan Pilz
              wrote on last edited by
              #6

              Hello Paddy, thanks for your answer. Your hint (undoc. feature) solves my problem. BR Stephan

                             \\\\\\|///
                           \\\\  - -  //
                            (  @ @  )
              

              +---------------oOOo-(_)-oOOo-----------------+
              | Stephan Pilz stephan.pilz@stephan-pilz.de |
              | www.stephan-pilz.de |
              | ICQ#: 127823481 |
              +-----------------------Oooo------------------+
              oooO ( )
              ( ) ) /
              \ ( (_/
              \_)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups