搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

How can I lock the scroll tab/bar?

  • 6 回覆
  • 1 有這個問題
  • 159 次檢視
  • 最近回覆由 baldohuskey

more options

Sometimes when online, I wish to keep a page from moving up and down. I wish there was a way(preferrably a handy keyboard shortcut) to make a webpage/browser unable to scroll up/down.

Sometimes when online, I wish to keep a page from moving up and down. I wish there was a way(preferrably a handy keyboard shortcut) to make a webpage/browser unable to scroll up/down.

被選擇的解決方法

There is a way to make a page unscrollable, which is to apply the style rule overflow:hidden to it. But making that convenient is a little bit of a challenge. One method would be to use a bookmarklet. That's a snippet of JavaScript code that you save on the Bookmarks Toolbar (or Bookmarks Menu, if you prefer). Clicking the bookmark runs the code on the current page.

If you would like to try it, here is the process:

(1) Select and copy the following long line of code:

javascript:var r="html,body{overflow:hidden !important;}"; var mysty=document.getElementById("noscrollrule"); if (!mysty){var s=document.createElement("style"); s.type="text/css"; s.id="noscrollrule"; s.appendChild(document.createTextNode(r)); document.body.appendChild(s);}else{mysty.remove();} void 0;

(2) Right-click either the Bookmarks Toolbar or Bookmarks Menu and choose New Bookmark

(3) Paste the code into the Location line

(4) In Name, type in something like NoScroll

(5) Click Add Bookmark

Then you can click the bookmarklet to test the result. On the first click, all scroll bars should disappear (the style rule is added to the page). On the second click, they should return (the style rule is removed from the page).

從原來的回覆中察看解決方案 👍 2

所有回覆 (6)

more options

The window should not scroll unless you told it to. Does this happen on one web page, several, all?

If you have a three button mouse, clicking the middle button turns the mouse into a scroll controller.

Do you have a mouse pad on the computer? I could be doing the scrolling. Turn it off to check.

Check your add-ons. Do and of them have anything to do with scrolling?

more options

My laptop has a touchpad with a scroll feature on the side. Not sure which would be easier to tweak, the application or the operating system, but I could look into disabling it via the touchpad software if Mozilla's browser cannot. By the way, thanks for your prompt assistance.

more options

選擇的解決方法

There is a way to make a page unscrollable, which is to apply the style rule overflow:hidden to it. But making that convenient is a little bit of a challenge. One method would be to use a bookmarklet. That's a snippet of JavaScript code that you save on the Bookmarks Toolbar (or Bookmarks Menu, if you prefer). Clicking the bookmark runs the code on the current page.

If you would like to try it, here is the process:

(1) Select and copy the following long line of code:

javascript:var r="html,body{overflow:hidden !important;}"; var mysty=document.getElementById("noscrollrule"); if (!mysty){var s=document.createElement("style"); s.type="text/css"; s.id="noscrollrule"; s.appendChild(document.createTextNode(r)); document.body.appendChild(s);}else{mysty.remove();} void 0;

(2) Right-click either the Bookmarks Toolbar or Bookmarks Menu and choose New Bookmark

(3) Paste the code into the Location line

(4) In Name, type in something like NoScroll

(5) Click Add Bookmark

Then you can click the bookmarklet to test the result. On the first click, all scroll bars should disappear (the style rule is added to the page). On the second click, they should return (the style rule is removed from the page).

由 jscher2000 - Support Volunteer 於 修改

more options

This is just what I was looking for, however when I tried it brought a sidebar up on the opposite side of the scroll bar. This sidebar looks almost identical to the history sidebar only instead of "History" the title is "NoScroll."

  I don't know for sure but maybe I copied the wrong part of code. I believe I included the whole clip, starting with: "JavaScript:var" and ending with "void;0". Interesting, I feel like it is on track, but not the solution.
  Thank you jscher for your help.
more options

Opening in the sidebar is the default for bookmarks that are created via a link or button on a website. You can check the properties of a bookmark via the right-click context menu in the sidebar (Ctrl+B; Command+B on Mac). In the Bookmarks Manager (Bookmarks > Show All Bookmarks) you can click the More button in the Details pane at the bottom right. Make sure that "Load this bookmark in the sidebar" is not selected.

more options

That did it! Thanks cor-el & jscher.