0

I need to create a script to scroll the ads on the website I am developing, with the pages. The want the ads to stay on screen when everything else scrolls, Anyone know where to find a good tutorial on this or have a good code to do this with that they are willing to share with me? Thanks in advance for any help.

3
Contributors
3
Replies
8
Views
4 Years
Discussion Span
Last Post by GraficRegret
0

There's lots of ways of doing it, the more sofisticated are with JavaScript, but it can be done easily done only with CSS, using position fixed.

See a example:

<!DOCTYPE html>
<html>

<body>
    <style type="text/css">

        #content {
            width: 500px;
            font-size: 30px;
        }

        #banner {
            position: fixed;
            top: 50px;
            right: 50px;
            width: 100px;
            height: 100px;
            background: #0F0;
            color: #FFF;
            font-size: 30px;
        }

    </style>
    <div id="content">
        nonononononononononnoon<br/>
        nonononononononononnoon<br/>
        nonononononononononnoon<br/>
        nonononononononononnoon<br/>nonononononononononnoon<br/>
        nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>
        nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>
        nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>
        nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>
        nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>nonononononononononnoon<br/>
    </div>

    <div id="banner">
        Something
    </div>


</body>
0

So if the Ads are just pictures, and you want them to scroll on the display, sounds like you can use a simple slider.

Where do you want to fix the banner? Where on the page? Do you want it visible all the time or when the user scrolls down?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.