अवलोकन
scrollX प्रॉपर्टी दस्तावेज़ के क्षैतिज स्क्रॉल पिक्सल को लौटाती है, यह pageXOffset के समान है।
उदाहरण
<!DOCTYPE html> <html> <head> <style> div { background-color: yellow; height: 1500px; width: 1500px; } </style> </head> <body> <script> function scrollFunc() { window.scrollBy(200, 200); alert("Horizontal: " + window.scrollX); } </script> <button onclick = "scrollFunc()" style = "position:fixed;">Scroll</button> <br><br><br> <div> </div> </body> </html>