treehouse : what would you like to learn today?
Web Design Web Development iOS Development

jQuery animated horizontal list, little help needed

  • Hello,

    I'm really newbie to JavaScript, so this is really basic.

    See example list here.

    If I ad the height of the li element, it ads the height in the bottom and my background images stay still. If I ad the margin to the top it works nice but it ads the margin to the top :) I would just like the li element to increase in height so that the backround image would move with it. You guys have any idea how would I achieve this?

    All help is tremendously appreciated!

    Thanks.
  • If you want the bus to come, just light a cigarette. Or to solve a problem, post it to forum :)

    I made a longer BG-image and positioned it to the bottom and increased the height. See it here (test2).

    I bet it could be cleaner and better... Suggestions?

    If JavaScript is disabled, how do I get it to fall back to the normal css based navigation? See what I mean hear (only-css).

    Here's the JavaScript so far:

    $(function() {

    $('.page_item a').hover(function() {

    $(this).animate({
    height: \"175px\"

    },{queue:false, duration:70});

    }, function() {

    $(this).stop().animate({
    height: \"135px\"

    },{queue:false, duration:70});
    });
    });


    Thanks!!