1
Well, I have an html page with a background image, only when the page clicks, it appears in a weird way. Is there any way she could gently press the page? I am using a code that changes the image every time I load the page.
<script>
var fundos = 20;
ran = Math.round(Math.random() * (fundos-1))+1
if (ran == (1)) {
url_background=("img/1.png");
}
if (ran == (2)) {
url_background=("img/2.png")
}
if (ran == (3)) {
url_background=("img/3.png");
}
if (ran == (4)) {
url_background=("img/4.png")
}
if (ran == (5)) {
url_background=("img/5.png");
}
if (ran == (6)) {
url_background=("img/6.png")
}
if (ran == (7)) {
url_background=("img/7.png");
}
if (ran == (8)) {
url_background=("img/8.png")
}
if (ran == (9)) {
url_background=("img/9.png");
}
if (ran == (10)) {
url_background=("img/10.png");
}
if (ran == (11)) {
url_background=("img/11.png")
}
if (ran == (12)) {
url_background=("img/12.png");
}
if (ran == (13)) {
url_background=("img/13.png")
}
if (ran == (14)) {
url_background=("img/14.png")
}
if (ran == (15)) {
url_background=("img/15.png");
}
if (ran == (16)) {
url_background=("img/16.png")
}
if (ran == (17)) {
url_background=("img/17.png");
}
if (ran == (18)) {
url_background=("img/18.png")
}
if (ran == (19)) {
url_background=("img/19.png");
}
if (ran == (20)) {
url_background=("img/20.png")
}
</script>
I’ll try to.....
– user18359
It didn’t work, I took the code that changes the background with Reload, but it didn’t work.
– user18359
@Gustavobarbosa has the jQuery loaded?
– Sergio
Sorry for the delay. Yes. <script src=". /js/jquery.js"></script>
– user18359