User:TheMcr/monobook.js: Difference between revisions

Boobpedia - Encyclopedia of big boobs
Jump to navigationJump to search
No edit summary
No edit summary
Tag: Manual revert
Line 1: Line 1:
// Add a style element to the page for the hover effect
document.addEventListener('DOMContentLoaded', function () {
document.addEventListener('DOMContentLoaded', function () {
     var images = document.querySelectorAll('img'); // Select all images on the page
     var style = document.createElement('style');
 
     style.innerHTML = `
     images.forEach(function (image) {
         /* CSS for image hover effect */
         // On mouse enter (hover)
         img:hover {
         image.addEventListener('mouseenter', function () {
             transform: scale(1.1); /* Grows the image to 110% of its original size */
             image.style.transition = 'transform 0.3s ease';  // Smooth transition for scaling
             transition: transform 0.3s ease; /* Smooth transition */
            image.style.transform = 'scale(1.1)'; // Increase image size by 10%
         }
        });
    `;
 
     document.head.appendChild(style);
        // On mouse leave (hover out)
        image.addEventListener('mouseleave', function () {
             image.style.transform = 'scale(1)'; // Reset to original size
         });
     });
});
});

Revision as of 22:46, 1 April 2025

// Add a style element to the page for the hover effect
document.addEventListener('DOMContentLoaded', function () {
    var style = document.createElement('style');
    style.innerHTML = `
        /* CSS for image hover effect */
        img:hover {
            transform: scale(1.1); /* Grows the image to 110% of its original size */
            transition: transform 0.3s ease; /* Smooth transition */
        }
    `;
    document.head.appendChild(style);
});