0

I'm trying to create a very simple jQuery slider; however, to get started, I wanted to position my divs next to eachother instead of underneath eachother so I could animate the 'left:' css value. I'm dumb and completely failing at this though. I don't get it.

Here's an example of the code I'm playing with:

http://jsfiddle.net/YUQWx/1/

I don't understand why they stay below eachother instead of going next to eachother. The left: seems to be getting ignored? I'm probably missing out on something here.

Thanks in advance.

Joris Ooms
  • 11,880
  • 17
  • 67
  • 124

3 Answers3

2

You're spelling .scrolling-content with a dash in the CSS, but with an underscore (<div id="zone_a" class="scrolling_content">) in the HTML. Fix the spelling, and you'll be fine :-)

Pär Wieslander
  • 28,374
  • 7
  • 55
  • 54
1

Have you tried float: left;. Change the following:

#scrollzone
{
    width: 700px;
    height: 200px;
    position: relative;
    float: left;    
}

#zone_a, #zone_b, #zone_c
{
    width: 300px;
    float: left;
    height: 200px;    
    top: 0px;
}
Brian Fisher
  • 23,519
  • 15
  • 78
  • 82
1

You need to float the divs. Something like:

#div1 { 
    float: left;
    width: 200px;
}

#div2{ 
    float:left;
    width:200px;
}
stevecomrie
  • 2,423
  • 20
  • 28