কম্পিউটার

জাভাস্ক্রিপ্টে অনস্ক্রোল ইভেন্টের ব্যবহার কী?


অনস্ক্রল ইভেন্টটি ঘটে যখন স্ক্রলবার একটি উপাদানের জন্য স্ক্রোল করা হয়। কিভাবে অনস্ক্রোল বাস্তবায়ন করতে হয় তা শিখতে আপনি নিম্নলিখিত কোড চালানোর চেষ্টা করতে পারেন জাভাস্ক্রিপ্টে ইভেন্ট।

উদাহরণ

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            border: 2px solid blue;
            width: 300px;
            height: 100px;
            overflow: scroll;
         }
      </style>
   </head>
   
   <body>
      <div id="content">
         This is demo text. This is demo text.This is demo text.This is demo text.
         This is demo text.This is demo text.This is demo text.This is demo text.
         This is demo text.This is demo text.This is demo text.
         This is demo text.This is demo text.This is demo text.
         This is demo text.This is demo text.This is demo text.
      </div>
      <p id = "myScroll"> </p>
      <script>
         document.getElementById("content").onscroll = function() {myFunction()};
         function myFunction() {
            document.getElementById("myScroll").innerHTML = "Scroll successfull!.";
         }
      </script>
   </body>
</html>

  1. জাভাস্ক্রিপ্টে ক্লায়েন্টওয়াই মাউস ইভেন্টের ভূমিকা কী?

  2. জাভাস্ক্রিপ্টে ক্লায়েন্টএক্স মাউস ইভেন্টের ভূমিকা কী?

  3. জাভাস্ক্রিপ্টে স্ক্রিনওয়াই মাউস ইভেন্টের ভূমিকা কী?

  4. JavaScript এ every() পদ্ধতির ব্যবহার কি?