Preamble: Asked to write a simple one-page, without admin. Quickly minted on the bootstrap, what was needed, and added animation of the appearance of sections (the same scrollreveal.js)
Everything worked great like this.
<head> <script src="scrollreveal.min.js"></script> <script src="jquery.min.js"></script> </head> <body> <section class="animated"> </section> <section class="animated"> </section> <section class="animated"> </section> <script> ScrollReveal().reveal('.animated'); </script> </body> Ambula: later, asked to transplant this page to ERP Odoo. That's where the problems started - scrollreveal.js stopped working. More precisely stopped working half. All sections with the class animated script are opacity:0 , but when the section is in the viewport, the section opacity does not become = 1, i.e. remains transparent.
Experienced to find out that events onscroll do not work at all. I added a small script to the page code:
<script> window.onscroll = function () { console.log('qwe'); }; </script> Nothing was logged. (I checked the same script locally on the html page, where did you go wrong? No, the log is written locally, the scan is working).
I don’t know where to dig further. Maybe you have any thoughts on this? Thank you in advance.
upd. Another moment header with absolute positioning in odoo for some reason behaves like position:fixed (или stiky) remains glued to the top of the viewport. (Again, it behaves normally on a simple html page). I do not know if there is a connection with the problem above, but maybe someone will push on the right thought.
upd2. In order for odoo to create a page, it is necessary that it be in xml. The code in which onscroll doesn't work looks like this.
<?xml version="1.0" encoding="UTF-8"?> <odoo> <template id="myhomepage" inherit_id="website.homepage"> <xpath expr="." position="replace"> <t name="Homepage" priority="29" t-name="website.homepage"> <!--Дальше всё как в работающем html--> <head> </head> <body> </body> <!--Ну и закрывающие теги для xml--> </t> </xpath> </template> </odoo>
<html><head></head><body></body></html>. But doctype is not declared - Sjeurt