Commit a2862376 by wd

修改返回顶部方式,取消链接功能添加js返回

parent 01c344fc
......@@ -7,9 +7,9 @@
?>
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('public_footer')->toHtml();?>
<a href="#top" title="go to header" id="topBtn" style="display: none;">
<p title="go to header" id="topBtn" style="display: none;">
<img loading="lazy" src="<?php echo $block->getViewFileUrl('images/goTop.png'); ?>">
</a>
</p>
<script>
require([
......
......@@ -21,6 +21,7 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
?>
<script>
//go to top button show
window.onscroll = function (){
var top = document.getElementById("topBtn");
if (document.documentElement.scrollTop > 200 || document.body.scrollTop > 200){
......@@ -38,6 +39,12 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
}
require(['jquery'],function ($){
//go to top button click
$('#topBtn').click(function(){
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
});
if (flag){
var imgH = $('.logo').height();
imgH= Math.ceil(imgH/3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment