Introduction
Sometimes, when preparing screen shots from a website, scrollbars may appear. In such cases, creating a screen shot without these scrollbars can help enhance the beauty and clarity of the images. There are solutions to hide these scrollbars, one of which is using bookmarklets.
Bookmarklets are small tools that are usually provided in the form of JavaScript and can easily be attached to bookmark managers. By adding these scripts to bookmarklets, you can perform various actions on the web pages and execute them – such as hiding scrollbars.
Using Bookmarklets
Using bookmarklets to hide scrollbars is quite simple and quick. You can store a JavaScript script in a bookmark manager and whenever needed, by clicking on it, you can hide scrollbars and then prepare your image using screenshot tools.
How to Create a Bookmarklet
Below is an example of a script bookmarklet for hiding scrollbars:
javascript:(function()%7Bdocument.body.style.overflow%3D'none'%7D)()
Code Explanation
javascript:
Starts a bookmarklet that works using JavaScript.(function()%7B%7D)()
Is the structure of an anonymous function in JavaScript for ensuring no interaction with other codes.document.body.style.overflow%3D'none'
The main line that hides the scrollbars on the page by changing the overflow style to 'none'.In this way, you can use this bookmarklet to hide scrollbars and prepare screenshots without hassle.