#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    24
    Rep Power
    0

    Adjustable Display


    How can I do that in my example (http://jsfiddle.net/samuvk/sMqKA/16/)

    that the position of the display can be adjusted.

    When the last item (unlimitedwonders) display, the two items display are two far on the left that they cannot be reach.

    Is there any way that the elements display are adjusted to the positions of the "father" element?

    Thanks
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,040
    Rep Power
    119
    Look @ the .css() API or just adjust your CSS style; when :hover occurs.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    24
    Rep Power
    0
    Originally Posted by web_loone08
    Look @ the .css() API or just adjust your CSS style; when :hover occurs.

    I'm sorry but I don't know how to do so.

    Any help please??

    thanks
  6. #4
  7. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,122
    Rep Power
    4258
    Why are you using JavaScript to generate the menu and why are you appending <li> elements directly to a <div>?

    Is there any way that the elements display are adjusted to the positions of the "father" element?
    Of course there's a way. In fact there are multiple ways to solve that. I would recommend correcting that with just CSS, not using JavaScript to change the style.

    P.S. By "father", you mean "parent".
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    24
    Rep Power
    0
    Yes I meant parent.

    I'm really new on this, in fact, this is my first try coding and almost all you are saying sounds Chinese to me.

    Could you please help me out a little further?

    Thanks again
  10. #6
  11. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,122
    Rep Power
    4258
    Oh. Then don't use JavaScript like that for a menu until you understand the code itself and why making a menu like that is is a poor choice compared to the alternatives.

    I suggest you use the Suckerfish Menu system. This explains the technique:
    http://www.htmldog.com/articles/suckerfish/dropdowns/
    and this shows some improvements to it:
    http://www.positioniseverything.net/css-dropdowns.html
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo