You could place any kind of content you'd like inside a scrollable area—a list of news stories, a gallery of photos, or a long article with several sections, headings, and subheadings, for example. Here's how you can set up a control to smoothly scroll from one section to another:
The first thing we'll need to do is assign an ID to each of our paragraphs. I have five paragraphs of lorem ipsum in my scrollable area, so I'm going to assign them
id
s ofpara1
,para2
,para3
,para4
, andpara5
. You can choose whateverid
s you like, but keep in mind that anid
cannot begin with a number. So now my code looks like this (I've truncated the text to save space):<div id="scrolling"> <p id="para1">Lorem ipsum...</p> <p id="para2">...</p> <p id="para3">...</p> <p id="para4">...</p> <p id="para5">...</p> </div>
Now, let's add in some internal links above...