Salut
Avec ce plugin [
[extension by Piwigo Team] LocalFiles Editor] --> Plugin personnel
<?php
add_event_handler('loc_end_page_header', 'scroll_to_top');
function scroll_to_top()
{
global $template;
$template->set_prefilter('header', 'scroll_to_top_pref', 100);
}
function scroll_to_top_pref($content)
{
$search = '<body id="{$BODY_ID}" class="{foreach from=$BODY_CLASSES item=class}{$class} {/foreach}" data-infos=\'{$BODY_DATA}\'>';
$scroll = '
{html_style}{literal}
.scrollup {
width:48px; height:48px; opacity:0.7; position:fixed; border-radius:24px;
bottom:50px; right:50px; display:none; text-indent:-9999px;
background: rgba(255,255,255,0.8) url("https://beauxvoyages.fr/photos/img/down.png") no-repeat;
z-index:1000; border:none !important; text-decoration:none !important;
}
.scrollup:hover { opacity:1; }
{/literal}{/html_style}
{footer_script}{literal}
jQuery(window).scroll(function(){
if (jQuery(this).scrollTop() > 100) {
jQuery(".scrollup").fadeIn();
} else {
jQuery(".scrollup").fadeOut();
}
});
jQuery(".scrollup").click(function(){
jQuery("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
{/literal}{/footer_script}
<a href="#" class="scrollup">Scroll</a>';
return str_replace($search, $search.$scroll, $content);
}
?>