Using this function must be integrated into the jquery package
Principle: When the browser moves to a specified location, the layer floats up, and then adds a style to allow the div layer to be positioned at the top of the browser
The code copy is as follows:
//Control the display of head shopping cart
function fixshow(min_height){
min_height ? min_height = min_height : min_height = 830;
$(window).scroll(function(){
var s = $(window).scrollTop();
if( s > min_height){
$("#proBuyTip").fadeIn(100);
$(".fixtabwrap").addClass("topfixed");
}else{
$("#proBuyTip").fadeOut(200);
$(".fixtabwrap").removeClass("topfixed");
};
});
};
The code copy is as follows:
.topfixed {
position: fixed !important;
top: 0px;
left: 0px;
z-index: 999;
width: 100%;
background-color: white;
position: absolute;
_top: expression(eval(document.documentElement.scrollTop));
}