lundi 18 décembre 2023

Issue of random background in firefox browser

I've got script of random background which is working of every browser except firefox (only mobile version). In this browser the images not covering all screen but some part.

Here is a code:

<script>function pic() {

var bgm = ['image1.webp', 'image2.webp'];

$('body').css({ 'background': 'url(' + bgm[Math.floor(Math.random() * bgm.length)] + ') no-repeat', 'background-attachment': 'fixed', 'background-position': '50% 50%', 'background-size': 'cover' }); }

pic();

Why on firefox browser (only mobile version) the image not cover all screen?




Aucun commentaire:

Enregistrer un commentaire