javascript - js效果在本地好好的,到了服务器效果不流畅。
巴扎黑
巴扎黑 2017-04-11 12:40:25
[JavaScript讨论组]

鼠标滚轮向下拉导航栏高度减小,向上拉又回到原来高度,这是一个渐变的过程。

$waypoint_selector.waypoint( {
                        offset: function() {
                            if ( etRecalculateOffset ) {
                                setTimeout( function() {
                                    et_calculate_header_values();
                                }, 200 );

                                etRecalculateOffset = false;
                            }
                            if ( et_hide_nav ) {
                                return et_header_offset - et_header_height - 200;
                            } else {

                                // Transparent nav modification: #page-container's offset is set to 0. Modify et_header_offset's according to header height
                                var waypoint_selector_offset = $waypoint_selector.offset();

                                if ( waypoint_selector_offset.top < et_header_offset ) {
                                    et_header_offset = 0 - ( et_header_offset - waypoint_selector_offset.top );
                                }

                                return et_header_offset;
                            }
                        },
                        handler : function( direction ) {
                            et_fix_logo_transition();

                            if ( direction === 'down' ) {
                                $main_header.addClass( 'et-fixed-header' );
                                $main_container_wrapper.addClass ( 'et-animated-content' );
                                $top_header.addClass( 'et-fixed-header' );

                                if ( ! et_hide_nav && ! $et_transparent_nav.length && ! $( '.mobile_menu_bar' ).is(':visible') ) {
                                    var secondary_nav_height = $top_header.height(),
                                        et_is_vertical_nav = $( 'body' ).hasClass( 'et_vertical_nav' ),
                                        $clone_header,
                                        clone_header_height,
                                        fix_padding;

                                    $clone_header = $main_header.clone().addClass( 'et-fixed-header, et_header_clone' ).css( { 'transition': 'none', 'display' : 'none' } );

                                    clone_header_height = $clone_header.prependTo( 'body' ).height();

                                    // Vertical nav doesn't need #page-container margin-top adjustment
                                    if ( ! et_is_vertical_nav ) {
                                        fix_padding = parseInt( $main_container_wrapper.css( 'padding-top' ) ) - clone_header_height - secondary_nav_height + 1 ;

                                        $main_container_wrapper.css( 'margin-top', -fix_padding );
                                    }

                                    $( '.et_header_clone' ).remove();
                                }

                            } else {
                                $main_header.removeClass( 'et-fixed-header' );
                                $top_header.removeClass( 'et-fixed-header' );
                                $main_container_wrapper.css( 'margin-top', '-1px' );
                            }
                            setTimeout( function() {
                                et_set_search_form_css();
                            }, 400);
                        }
                    } );
巴扎黑
巴扎黑

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号