Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

221
Visualizações
How to get an external funtion in a .html?

I want to get a function or a variable into a .html code from a javascript code. I have to toggle layers of a map made on mapbox in a wix site. Have this click event that changes a bool in javascript:

$w('#au').onClick((event) =>{
if(isMatch)
{
    $w('#img').hide();
    $w('#Basic').hide();
    isMatch = false; 
}
else{
    $w('#img').show();
    $w('#Basic').show();
    isMatch = true;
}
});

Now I want to get this bool, or any another variable or function, and use it as a condition inside my .html, which is like this:

<script>

mapboxgl.accessToken = 'pk.eyJ1Ijoiam9hb3BlZHJvdmdhIiwiYSI6ImNreGtqMHZxZTJwcTIzMHB6Y2lnMm00czkifQ.auBfiQMlyayVxRlHCPuPkQ' 
;
const map = new mapboxgl.Map ({ 
container: 'map', 
style: 'mapbox://styles/joaopedrovga/ckxkj2aon1xh314me52nin8w8'
});
map.on('idle', () => {
"HERE I WANT TO CALL THE FUNTION OR GET THE VARIABLE"
map.setLayoutProperty('water', 'visibility', 'none');
});
about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda