JS not working properly on mobile

Hi everyone,

I have a problem with JS code. If you press on an element, it is supposed that appears a div element where you can find some options. It was working properly, no problem at all, but I don’t why is not working on mobil designs. I have proved it on Safari and Chrome.

HTML code:

<div id="sesion_popup_movil">
                    <a href="<?php echo $ruta ?>Iniciar-Sesion/">Login avanzado</a>
                    <a href="<?php echo $ruta ?>Registro/">Registrarse</a>
                    <form class="credenciales"  action="index.php" method="post">
                        <div class="inputs">
                            <input type="text" name="usuario" placeholder="Usuario:">
                            <input type="password" name="password" value="Contraseña:">
                        </div>
                        <input class="submit_login" type="submit" name="submit_login" value="►">
                    </form>

                </div>

                <div id="panel_usuario_popup_movil">
                    <div class="fila">
                        <div class="fila-enlace">
                            <div class="icon_wrapper">
                                <i class="fa fa-sliders" aria-hidden="true"></i>
                            </div>
                            <a href="<?php echo $ruta ?>cp/Inicio/Inicio/">Panel de control</a>
                        </div>

                        <div class="fila-enlace">
                            <div class="icon_wrapper">
                                <i class="fa fa-envelope" aria-hidden="true"></i>
                            </div>
                            <a href="<?php echo $ruta ?>cp/Mensajes-privados/Recibidos/">Mensajes privados</a>
                        </div>
                    </div>

                    <div class="fila">
                        <div class="fila-enlace">
                            <div class="icon_wrapper">
                                <i class="fa fa-trophy" aria-hidden="true"></i>
                            </div>
                            <a href="<?php echo $ruta ?>cp/Inicio/Logros/">Progreso de logros</a>
                        </div>

                        <div class="fila-enlace">
                            <div class="icon_wrapper">
                                <i class="fa fa-commenting" aria-hidden="true"></i>
                            </div>
                            <a href="#">Mis mensajes</a>
                        </div>
                    </div>

                    <div class="fila">
                        <div class="fila-enlace">
                            <div class="icon_wrapper">
                                <i class="fa fa-bookmark" aria-hidden="true"></i>
                            </div>
                            <a href="#">Mis hilos abiertos</a>
                        </div>

                        <div class="fila-enlace">
                            <div class="icon_wrapper">
                                <i class="fa fa-at" aria-hidden="true"></i>

                            </div>
                            <a href="<?php echo $ruta ?>cp/Inicio/Menciones/">Mis menciones</a>
                        </div>
                    </div>

                    <div class="fila">
                        <div class="fila-enlace">
                            <div class="icon_wrapper">
                                <i class="fa fa-star" aria-hidden="true"></i>
                            </div>
                            <a href="#">Mis hilos favoritos</a>
                        </div>

                        <div class="fila-enlace">
                            <div class="icon_wrapper">
                                <i class="fa fa-power-off" aria-hidden="true"></i>
                            </div>
                            <a href="<?php echo ruta ?>cerrar_sesion.php">Cerrar sesión</a>
                        </div>
                    </div>
                </div>

JS code:

$('#invitado_movil').click(function(){
        console.log(count);
        if (count == 0) {
            document.getElementById('sesion_popup_movil').style.display = 'block';
            document.getElementById('invitado_movil').style.color = 'black';
			document.getElementById('inicio_registro_movil').style.display = 'none';
            count = 1;
        } else {
            document.getElementById('sesion_popup_movil').style.display = 'none';
            document.getElementById('invitado_movil').style.color = 'white';
			document.getElementById('inicio_registro_movil').style.display = 'flex';
            count = 0;
        }

    });

	$('#sesion_usuario_movil').click(function(){
		console.log(count);
		if (count == 0) {
			document.getElementById('panel_usuario_popup_movil').style.display = 'block';
			document.getElementById('sesion_usuario_movil').style.color = 'black';
			document.getElementById('inicio_registro_movil').style.display = 'none';
			count = 1;
		} else {
			document.getElementById('panel_usuario_popup_movil').style.display = 'none';
			document.getElementById('sesion_usuario_movil').style.color = 'white';
			document.getElementById('inicio_registro_movil').style.display = 'flex';
			count = 0;
		}

	});

If you try on PC works OK, even if you reduce the screen size that you reach to a mobile design, and it keeps working, but not on mobile. You can check if you want here: http://www.laxtore.com/index.php

[off-topic]
Hi @egoicantero
I have de-linked your URL because some members have reported that their AV software was detecting malware at that address. You may want to look into this.

What kind of malware? How can I check that? You can delete the link for security. Sorry about that, I don’t even know how to check that, so If you can also give me some tips I will also appreciate.

There are various online scanners which will check for malware. I tried your site in virustotal.com and sitecheck.sucuri.net, both of which are well-known and reputable. The former found no issues, and the latter reported malware, which seems to be ad-related.

Automated scans caan only go so far; you’ll need to check the results and your site for yourself to determine whether or not there’s a problem, or whether it’s some kind of false positive.

1 Like

Thanks! Just for curiosity, is that related to using https?

I don’t think so. (It was another member who reported the problem initially, and I don’t know exactly what warning(s) they saw, or which antivirus they were using.)

Thanks anyway. I have been trying to see if I was warned by google, but nothing yet. What I have read is that if you are infected Google warns you…

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.