জাভাস্ক্রিপ্টে ব্যাকগ্রাউন্ড ইমেজ ফিক্সড করতে backgroundAttachment প্রপার্টি ব্যবহার করা হয়। এটি এমন একটি ইমেজ সেট করে যা স্ক্রোল হবে না।
উদাহরণ
<!DOCTYPE html> <html> <body> <button onclick="display()">Click to Set background</button> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <p>Demo Text</p> <script> function display() { document.body.style.background = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg') no-repeat right top"; document.body.style.backgroundAttachment = "fixed"; } </script> </body> </html>