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

163
Visualizações
OdooV14 - Make Appear Header Logo on Scroll Down

I'm trying to make my logo appear in my header when i scroll down. It works normally on a simple html page but it does not work on Odoo Website.

In odoo website I placed my JS file like this in assets.xml :

<template id="assets_editor" name="Vichysport's Script" inherit_id="website.assets_editor" priority="1">
    <xpath expr="script[last()]" position="after">
        <script type="text/javascript" src="/vichysport/static/js/template.js"/>
    </xpath>
</template>

My manifest is ok and i call my layout.xml and my assets.xml

I don't really understand why it don't works... but here is an exemple of my code.

<!DOCTYPE html>
<html>

<head>
  <style>
    #LogoSvg {
      opacity: 0;
      position: fixed;
      margin: 1% auto; /* Will not center vertically and won't work in IE6/7. */
      left: 0;
      right: 0;
    }
  </style>
  <script>
    window.onscroll = function() {hideornot()};

    function hideornot() {
      if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
        document.getElementById("LogoSvg").style.opacity = "100%";
      } else {
        document.getElementById("LogoSvg").style.opacity = "0%";
      }
    }
  </script>
</head>


<body style="height:1500px">

  <p>Scroll down this page</p>

  <svg id="LogoSvg" xmlns="http://www.w3.org/2000/svg" width="83.999" height="84" viewBox="0 0 83.999 84">
    <g id="Groupe_9299" data-name="Groupe 9299" transform="translate(549.139 66.665)">
       <rect id="Rectangle_2908" data-name="Rectangle 2908" width="27.998" height="28.001" transform="translate(-549.139 -66.665)" fill="#0e3144"></rect>
       <rect id="Rectangle_2909" data-name="Rectangle 2909" width="27.998" height="28.001" transform="translate(-493.14 -66.665)" fill="#0e3144"></rect>
       <rect id="Rectangle_2910" data-name="Rectangle 2910" width="27.998" height="27.998" transform="translate(-549.139 -10.663)" fill="#0e3144"></rect>
       <rect id="Rectangle_2911" data-name="Rectangle 2911" width="27.998" height="27.998" transform="translate(-493.14 -10.666)" fill="#0e3144"></rect>
    </g>
  </svg>

</body>

</html>

Can someone help me to understand why ? Thanks

about 4 years ago · Juan Pablo Isaza
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