So im working in this page https://www.pacificotest.com.pe/.
- When someone scroll the page, the box that appears when you type "Clinica "
move is not absolute, and when I change it to absolute it keep moving anyway.
- Is there any code of css, js or jquery that unify two Classes or ID together,
so they dont get far from each other?
When you scroll down a little bit
So the script that i create is this one:
<script>
$(window).scroll(function () {
if ($(window).scrollTop() >= 1) {
$('.autocomplete-suggestions').each(function(i,j) {
$(this).addClass('fix-searcher'+(i+1));
});
}
});
$(window).scroll(function () {
if ($(window).scrollTop() >= 15) {
$('.aui .fix-searcher1').addClass("fixed");
$('.aui .fix-searcher1').removeClass("fix-searcher1");
$('.aui .fix-searcher2').addClass("fixed2");
$('.aui .fix-searcher2').removeClass("fix-searcher2");
} else {
$('.aui .fix-searcher1').removeClass("fixed");
$('.aui .fix-searcher1').addClass("fix-searcher1");
$('.aui .fix-searcher2').removeClass("fixed2");
$('.aui .fix-searcher2').addClass("fix-searcher2");
}
});
</script>
CSS:
.fixed{
position: fixed ! important;
top:100px ! important;
}
.fixed2{
position: absolute ! important;
top:430px ! important;
z-index:100 ! important;
}
div.dropdown-menu.flyover {
margin-top: -1px !important;
}
div.portlet-borderless-container div.portlet-body div.news-card div.text .category {
z-index: 0;
}
.fix-searcher1{
position: fixed ! important;
top:140px ! important;
}
.fix-searcher2{
top:490px ! important;
z-index:100 ! important;
}
.aui .autocomplete-suggestions {
margin-top: 0 ! important;
}
.sub-menu-affix {
background-size: 12px 180%,12px 180%,0, 0 ! important;
}