在我通过的代码中有一个链接有href = javascript:; 在code.when点击它打开一个灯箱,显示一些msg与关闭button.ow它已完成.我认为这使用dojo
我有一个带有大徽标的标题,我想在滚动超过 100 像素后将其缩小,这工作正常但不流畅,我怎样才能让它平滑?
我的代码:-
$(function(){
$(window).scroll(function(){
if($(this).scrollTop() > 100){
$('header').addClass('fixed-header');
}
else{
$('header').removeClass('fixed-header');
}
});
});Run Code Online (Sandbox Code Playgroud)
header{ padding:0px; position: sticky; top:0px; left:0px; background: #FFF; z-index: 1000;}
header.fixed-header{box-shadow: 20px 4px 10px rgba(39, 59, 69, 0.2);}
header .logo img{width:200px;}
header.fixed-header .logo img{width:100px;}
.box-height{ height:500px;}Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<header>
<div class="col-md-4">
<a href="#" class="logo"><img src="https://www.freepnglogos.com/uploads/google-logo-png-hd-11.png"></a>
</div>
</header>
<div class="box-height"></div>Run Code Online (Sandbox Code Playgroud)