SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Dec 2001
    Location
    Market Harborough, UK
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <SELECT>'s on a mobile <DIV>

    Grrr....

    Just when it was all going so well!

    I have some <SELECT> form elements which are on a <DIV>. It would seem, however, that they don't inherit their properties and I don't know why!

    Not only do they appear in front of other <DIV>s regardless of z-index, but now I find that if I move the <DIV>, the <SELECT>'s don't move with it!

    How can I force the <SELECT> to inherit it's properties from the <DIV>?

    Cheers
    Paul Simpson, BSc, MCNI, MCNE

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    The problem with <select>s is that they're drawn by the OS, not the browser (i.e. textboxes). This is true for other things as well, like Java applets and Flash movies. What you can do is make the <select> invisible when another <div> is over it by setting its visibility property to "hidden", then showing it again when there is nothing over it.

  3. #3
    SitePoint Addict
    Join Date
    Dec 2001
    Location
    Market Harborough, UK
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As always, thanks Vinnie! Is that why they don't move as well?

    It's a real pain because the <DIV>s in question are part of a menu system. As such the <SELECT>s are often only partially obscured. Also, I use a standard menu regardless of the page content, so it's impossible within the menu code to know what <SELECT>s to hide....

    Is there a quick way of cycling around all od the elements on a page of a particular type? That way, when the user accesses the menu, I could have the function simply hide all the <SELECT>'s on the page!

    Paul
    Paul Simpson, BSc, MCNI, MCNE

  4. #4
    SitePoint Addict
    Join Date
    Dec 2001
    Location
    Market Harborough, UK
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've solved the movement problem! If I put the <SELECT>'s inside a table in the <DIV>, it works! (providing the cell contains something in addition to the <SELECT> itself, for eaxmple &nbsp;....

    Now I just need them to hide when the menu is activated and......
    Paul Simpson, BSc, MCNI, MCNE

  5. #5
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    give them classnames
    mySels = document.getElementsByTagName('select');
    if (var i = 0; i < mySels.length; i++)
    if (mySels[i].className == 'something')
    dosomething();

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  6. #6
    SitePoint Addict
    Join Date
    Dec 2001
    Location
    Market Harborough, UK
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, thanks!

    I'll get onto that right away - maybe I will soon have the users actually being satisfied!!

    Paul
    Paul Simpson, BSc, MCNI, MCNE


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
  •