Hyperlink error HTML code

Asked

Viewed 47 times

0

Hey there, guys. I don’t know much about programming, I took a code and developed a little according to what I wanted, but the hyperlink of each entry does not work, I tried several ways to solve, but nothing worked so far. Can someone give me a hand?

<html>
<head>
<style>
/* Menu */
.sidepanel {
    height: 290px;
    width: 0;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    background-color: #E1E1E1;
    overflow-x: hidden;
    padding-top: 0px;
    transition: 0.2s;
}

/* Menu Cor */
.sidepanel a {
    padding: 8px 8px 8px 25px;
    text-decoration: none;
    font-size: 14px;
     font-family: Arial;
    color: #2C2C2C;
    display: block;
    transition: 0.3s;
}

/* Menu MouseOver Cor */
.sidepanel a:hover {
    color: #A1A1A1;
}

/* Posição e Cor do botão FecharMenu */
.sidepanel .closebtn {
    position: absolute;
    margin-top: 0;
    margin-left: 0;
    width: 70;
    height: 270;
}

/* Estilo e Botão que abre Menu */
.openbtn {
    cursor: pointer;
    background-color: hsla(0,0%,40%,0.74);
    margin-top: 110;
    margin-left: 5;
    padding: 10px;
    border: none;
}

.openbtn:hover {
    background-color: #00F832;
}
</style> 
</head>
<body bgcolor="747474">
<div id="mySidepanel" class="sidepanel">
  <a href="" class="closebtn" onMouseOut="closeNav()"></a>
  <a href="local:|foxs:|file:^px/BRASIL/SP/291/Ventilador/Ventilador.px">Resumo</a>
  <a href="local:|foxs:|file:^px/BRASIL/SP/291/Ventilador/Ventilador.px">Loja</a>
  <a href="local:|foxs:|file:^px/BRASIL/SP/291/CAG/CAG.px">CAG</a>
  <a href="local:|foxs:|file:^px/BRASIL/SP/291/Ventilador/Ventilador.px">Fancoils</a>
  <a href="local:|foxs:|file:^px/BRASIL/SP/291/Ventilador/Ventilador.px">Ventilador</a>
  <a href="local:|foxs:|file:^px/BRASIL/SP/291/Ventilador/Ventilador.px">Energia</a>
  <a href="local:|foxs:|file:^px/BRASIL/SP/291/Ventilador/Ventilador.px">Nobreak</a>
  <a href="local:|foxs:|file:^px/BRASIL/SP/291/Ventilador/Ventilador.px">Gerador</a>
  <a href="local:|foxs:|file:^px/BRASIL/SP/291/Ventilador/Ventilador.px">Intrusão</a>
</div>
<button class="openbtn" onMouseOver="openNav()"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFxSURBVGhD7dk9L0RBGIbhFRGJQkKjQUJFR0VHSamlV+v9AD9ArdZSUtJRUelUCo1CohCf97ObTTab/ThnzjjzvjJPciW7292VmdHIy8vLK7I5HLQ++t48fnDY/OZ47RA50g9e1xkixxiBu3WHyAlG4Wq9QuQUY3CzfiFyjnG42KAQucQEzG9YiFxjEqZXJERuMQ2zKxoi95iByZUJkQfoWGNuZUPkEYswtZAQecIyzCw0RJ6xChOrEiIvWEfyVQ2RV2wi6WKEyBu2kWyxQuQdO0iymCHyiT3Uvtgh8oVd1Lq/CNFf/1nUutghd0hyHosZcoNkJ+RYIVdIemeJEXKB5LfIqiFnMHGvrxJi6qUlNMTc21dIiMnXyLIhZt+Hy4SYfrEvEvIN8/9DGRai0+w+zG9QyAeSHMlD1i8k6SUpZL1CdG3dgqt1h+ghYQPu1hmip501uFw7RI9tK/rB6xSi58+l5jfHm8JC62Ne3j9co/ELbozEkvc5aZEAAAAASUVORK5CYII="max-width="20px" width="18px"></button> 
<script>
function openNav() {
 document.getElementById("mySidepanel").style.width = "100px";
}
function closeNav() {
 document.getElementById("mySidepanel").style.width = "0px";
}
</script>
</body>
</html>

  • Young you want to click where to close the sidebar?

  • I want the sidepanel to close itself when the mouse is no longer under it.

  • Dude but here it looks like it’s working normal... https://imgur.com/6JqlUr9

  • 1

    It just looks like it. I was able to figure out what it was. Onmouseout was formatted the same size as the Sidepanel overriding access to the links. So I wouldn’t let them click on any of them, I reformatted to stand next to the Sidepanel, so it works. Every time the mouse goes out of focus it closes itself. Thanks anyway, Hugo! I’m learning to program now.

1 answer

0

You’re putting something kind of weird on href, try to put the address, for example, let’s assume that your site is https://example.com and you have the fan page, you would do something like this

<a href="https://example.com/BRASIL/SP/291/Ventilador/Ventilador.html">Ventilador</a>

Recalling, in the href place the full link.

I hope I helped :D

  • This code goes inside a supervisory system, the link to navigation is the same. The problem is that the Mouseover to close the Sidepanel does not let the link work. Maybe it would work with some code inside the <script> to close the Sidepanel. But I couldn’t even run some.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.