Tagged: footer
-
AuthorPosts
-
April 16, 2021 at 10:20 am #1294749
Hi,
I’m looking for a css code to get a fixed footer that only appears when the mouse goes to the bottom of the page.
Like on this web site : https://www.sernball.fr
Best regards
April 19, 2021 at 7:34 am #1295128Hey asplinstudio,
There’s nothing like that in the theme by default unfortunately, and creating something like that would be out of scope of theme support. You could try searching for a plugin or third party code.
Best regards,
RikardApril 19, 2021 at 8:13 am #1295141this is called curtain effect and you can try this:
https://kriesi.at/support/topic/fixed-curtain-footer/#post-691135see result here ( only starting page ) : https://webers-testseite.de/pureinstall/
on my testpage i use this in child-theme functions.php:
// curtain effect of footer - function add_curtain_footer_effect(){ if(is_home()){ ?> <script type="text/javascript"> (function($) { $(window).bind("load resize", function() { setTimeout( function() { var socketh = $('#socket').outerHeight(); var footerh = $('#footer').outerHeight(); var spacerh = socketh + footerh - 5 ; $('#distance').css('height', spacerh ); $('#footer').css('bottom' , socketh); }, 150) }); })(jQuery); </script> <?php } } add_action('wp_footer', 'add_curtain_footer_effect');
and on quick css ( pay attention as the script above this is all only for home – so adjust to your needs):
.home #main > div { z-index: 3 !important; position: relative !important; } .home #footer { left: 0; width: 100%; z-index: 2; position: fixed } .home #socket { bottom: 0; left: 0; width: 100%; z-index: 2; position: fixed } .home #main #distance { clear: both; z-index: 0 !important; }
April 19, 2021 at 8:32 am #1295144see complete post here: https://kriesi.at/support/topic/fixed-curtain-footer/
With a little distance now – i think i can try a combination of ismaels code and mine to optimize the script.
…April 21, 2021 at 6:05 am #1295676 -
AuthorPosts
- You must be logged in to reply to this topic.