GtiClicker
GtiClicker

Reputation: 78

How to make a your page not scrollable but a div is scrollable

I am making a game with sidebar where you can get upgrades the pages scroll is disabled but I want it so when I reach enough upgrades in the sidebar you can scroll down to see the ones that exceed the page.

Any help is appreciated check out the game at https://clickersandbeyond.com Code below

        <div class="btn-holder" id="btnHolder">
            <button class="button" id="gas87" onclick="gas87()">Gas <br><strong>87</strong>(300 Clicks gives 1 autoclicks)</button>
            <button class="button" id="gas89" onclick="gas89()">Gas <br><strong>89</strong>(1,000 Clicks gives 5 autoclicks)</button>
            <button class="buttonSpecial" id="engine" onclick="V6Engine()">Upgrade engine to <strong>V6</strong>(5,000 Clicks allows you to have up to 400 autoclicks and also gives you 2 CpCs)</button>
            <button class="button" id="cylinders" onclick="cylinders()">Quote unquote "Large Cylinders" (10,000 Clicks gives 60 autoclicks)</button>
            <button class="button" id="nitro" onclick="nitro()">Nitro pack (60,000 Clicks gives 400 autoclicks)</button>
            <button class="buttonReqD" id="holeInHood" onclick="cutAHole()">Saw a "crude" hole in your hood (100,000 Clicks, puts a large, crude, hole in your hood so you can manage to fit a V8 engine in. Required to get V8)</button>
            <button class="buttonSpecial" id="V8engine" onclick="V8Engine()">Upgrade engine to <strong>V8</strong> (1,000,000 Clicks allows you to have up to 1,500 autoclicks and also gives you 4 CpCs)</button>
        </div>

Upvotes: 0

Views: 99

Answers (1)

jeffjenx
jeffjenx

Reputation: 17457

Use overflow-y: auto; or scroll in the sidebar container.

For example:

#btnHolder {
   max-height: 200px;
   overflow-y: auto;
}

When the content exceeds 200px, it will show a scrollbar.

Upvotes: 1

Related Questions