Hiển thị các bài đăng có nhãn Jquery Scroll web. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Jquery Scroll web. Hiển thị tất cả bài đăng

Thứ Sáu, 8 tháng 9, 2023

js scroll top

 



HTML:

<div id="site-wrappe">
<header class="site-header">
    <div class="mbi-globalhear">
        
        <div class="header__toggle">
            <a href="#" class="menu-toggle">
                <span></span>
                <span></span>
                <span></span>
            </a>
        </div>

        <div class="header__logo">
            <a href="#">
                <img src="images">
            </a>
        </div>

        <div class="mbi-shopcard">
            
            <div class="shop-cart"></div>
            
            <a href="#">
                <i class="fa fa-shopping-basket" aria-hidden="true"></i>
            </a>
        </div>

    </div>
</header>
</div>

CSS:
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 10;
    transition: all .3s;
    height: 70px;
    background: #fff;
    border-bottom: 1px solid #d9d9d9;
    z-index: 9999999999999;
}
.site-header.is-scroll-top {
    transform: translateY(-100%);
}
div#site-wrapper {
    padding-top: 70px;
    background: #fff;
}


JS:
function headerScroll() {

    const header = $('.site-header');
    let last_scroll_point = $(window).scrollTop();

    if (last_scroll_point > 0) {
        header.addClass('is-scroll-top');
    }

    $(window).on('scroll', function(e) {
        const scroll_point = $(this).scrollTop();
        // if(!$(header_search).hasClass('is-active')){
            if (scroll_point > last_scroll_point && scroll_point > 100) {
                header.addClass('is-scroll-top');

            } else {
                if (header.hasClass('is-scroll-top')) {
                    header.removeClass('is-scroll-top');

                }
            }
        // }
        last_scroll_point = scroll_point;
    });
}


Chủ Nhật, 23 tháng 6, 2013

duy chuyển chuột xuống hình ảnh tự động duy chuyển xuống ngay trên đầu trang



<script  type="text/javascript">
var flag123=1;
$(window).scroll(function(){
if(flag123!=1000){
t = parseInt($(window).scrollTop());
if(t>345){
$('.menu_row').show();
$('.menu_row').css({top:t});
}else{
$('.menu_row').hide();                   
}
}
});
$(document).ready(function(e) {
$(".close_button").click(function(){
$('.menu_row').hide(500);
flag123=1000;
});
$(".xoapopup").click(function(){
$.cookie("popup",0,{path:"/"});
alert("done");
//$.get("modules.php",{"name":"Shoping","op":"xoacookie"},function(){alert("done");});
});
</script>


http://www.mediafire.com/download/fx3mfl9389tl1nf/window_scroll.rar

link website: retot.com + clip.vn 
 #------------------------------------------------------------------------------------#
 if(flag123!=1000){
t = parseInt($(window).scrollTop())-51; 
// dấu (-50 or +50) là tùy chỉnh lên xuống của div đó
if(t>80){
$('.web_action').show();                             
$('.web_action').css({top:t});
}else{                                
$('.web_action').css({top:0,left:0});    
//$('.adv').hide();                
}
}
#--------------------------------------------------------------------------------------------------#

#### Javascript
$(window).scroll(function() {
if ($(window).scrollTop() > 180) {
    $("#thanh_cuon").addClass("thanh_cuon");
}
else {
    $("#thanh_cuon").removeClass("thanh_cuon");
}
});

#### CSS
.thanh_cuon {
    position: fixed;
    z-index: 999999;
    width: 1199px;
    top: 0;
    margin-top: 0;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    -webkit-animation-name: fadeInDown;
    animation-name: fadeInDown;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;

}