Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to change the navbar background on pagescroll.
So on the homepage the background is transparant with logo.png and when the user scrolls down, the background of the navbar changes to white and logo2.png is loaded.
An example:
I found several codesnippets but i can't get it to work on Drupal Bootstrap.
Does anyone have a working code for Drupal?
Thank you!
Comments
Comment #2
mindhunter75 CreditAttribution: mindhunter75 commentedI found out that the java file needs to be wrapped in:
(function ($, Drupal, window) {
// code here
})(jQuery, Drupal, window);
That's why the code didn't work!
I can now add a class to the navbar default.
But i don't know how to change the logo on scroll.
Comment #3
markhalliwellClosing per https://drupal-bootstrap.org/api/bootstrap/docs%21Contributing.md/group/...
Reason: site specific (requires custom CSS/JS)