Commit 047eadcc by lmf

优化返回顶部

优化sku复制功能
parents af1cad6d 86b76c94
...@@ -216,9 +216,10 @@ ...@@ -216,9 +216,10 @@
} }
@media (min-width: 1024px) { @media (min-width: 1024px) {
.product-reviews-summary{ .product-reviews-summary{
width: 100% !important; width: 50% !important;
margin-top: -5.8% !important; margin-top: -5.8% !important;
justify-content: flex-end !important; justify-content: flex-end !important;
margin-left: 50%;
} }
.box-tocart .fieldset .actions{ .box-tocart .fieldset .actions{
width: 100%; width: 100%;
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
?> ?>
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('public_footer')->toHtml();?> <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('public_footer')->toHtml();?>
<p title="go to header" id="topBtn" style="display: none;">
<img loading="lazy" src="<?php echo $block->getViewFileUrl('images/goTop.png'); ?>">
</p>
<script> <script>
require([ require([
'jquery' 'jquery'
...@@ -25,4 +28,36 @@ ...@@ -25,4 +28,36 @@
$("#search_mini_form_input").toggle(); $("#search_mini_form_input").toggle();
}); });
}); });
//go to top button show
window.onscroll = function (){
var top = document.getElementById("topBtn");
if (document.documentElement.scrollTop > 200 || document.body.scrollTop > 200){
top.style.display="block";
}else {
top.style.display="none";
}
}
var userAgentInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }
}
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);
$('.header ').css('margin-bottom',imgH);
}else{
var headerH = $('.page-header').outerHeight(true);
$('.columns').css('margin-top',headerH);
}
});
</script> </script>
\ No newline at end of file
...@@ -19,36 +19,6 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight() ...@@ -19,36 +19,6 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
? $logoSizeResolver->getHeight() ? $logoSizeResolver->getHeight()
: $block->getLogoHeight(); : $block->getLogoHeight();
?> ?>
<script>
window.onscroll = function (){
var top = document.getElementById("topBtn");
if (document.documentElement.scrollTop > 200 || document.body.scrollTop > 200){
top.style.display="block";
}else {
top.style.display="none";
}
}
var userAgentInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }
}
require(['jquery'],function ($){
if (flag){
var imgH = $('.logo').height();
imgH= Math.ceil(imgH/3);
$('.header ').css('margin-bottom',imgH);
}else{
var headerH = $('.page-header').outerHeight(true);
$('.columns').css('margin-top',headerH);
}
});
</script>
<span data-action="toggle-nav" class="action nav-toggle"><span><?= $block->escapeHtml(__('Toggle Nav')) ?></span></span> <span data-action="toggle-nav" class="action nav-toggle"><span><?= $block->escapeHtml(__('Toggle Nav')) ?></span></span>
<a <a
class="logo" class="logo"
......
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