我在滚动时使用此代码更改位置。问题是滚动到页面顶部时css SSLContext sslContext = null;
try
{
sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy() {
@Override
public boolean isTrusted(X509Certificate[] arg0, String arg1) throws CertificateException
{
return true;
}
}).build();
}
catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException e)
{
//Show some Msg
}
CloseableHttpClient httpClient = HttpClients.custom()
.setDefaultHeaders(headers)
.setSSLContext(sslContext)
.setSSLHostnameVerifier(new NoopHostnameVerifier())
.build();
无法正常工作。
这是代码。
top:'0px'
并链接到page。请帮助。感谢。
答案 0 :(得分:1)
试试这个。
var $div = $('div.bk-form-wrap');
$(window).scroll(function() {
var stickySidebar = $('.bk-form-wrap').offset().top;
if ($(window).scrollTop() > stickySidebar) {
$div.css({
position:'fixed',
height: '70px'
},1000);
$div.animate({
top: '95px'
//top:'100%',
// marginTop: - $div.height()
});
}
else if ($(window).scrollTop() == 0) {
//Call your event here
$div.css({
position:'relative'
});
$div.animate({
top: '0px'
},500);
}
});