1
其他关系,我有其中有许多其他功能的大功能,(但我不能拥有所有这些功能,因为做出错误与我的其他脚本),因此我只需要这使操作的功能,这我需要;最近我帮着找一个功能,但我认为这会错过其中隐藏内容的其他功能,并显示一个按钮,我需要的。当我运行该脚本运行良好,但不显示一个按钮,也没有隐藏的酒吧,当您返回到初始位置。我只测试了这个大脚本,以知道是否有我的错误和元素yep。查找的JavaScript
大脚本,您可以在这里,太觉得这是什么,我试图做See the code and example
你可以看看什么我想这个形象,这个问题上做的例子: See Picture of the problem
我现在的剧本是这样的,效果很好,但错过这两个细节是进入大脚本。请帮帮我。
// JavaScript Document
;
jQuery(document).ready(function() {
"use strict";
jQuery(window).scroll(function() {
var scrollTop = jQuery(window).scrollTop();
var docHeight = jQuery(document).height();
var winHeight = jQuery(window).height();
var scrollPercent = (scrollTop)/(docHeight - winHeight);
var scrollPercentRounded = Math.round(scrollPercent * 100);
jQuery('#post_indicator').css('width', scrollPercentRounded + '%');
});
jQuery(window).scroll(function() {
if (jQuery('#pp_fixed_menu').val() == 1)
{
if (jQuery(this).scrollTop() >= 200) {
jQuery('.header_style_wrapper .above_top_bar').hide();
jQuery('.extend_top_contact_info').hide();
jQuery('.top_bar').addClass('scroll');
jQuery('#post_info_bar').addClass('scroll');
} else if (jQuery(this).scrollTop() < 200) {
jQuery('.header_style_wrapper .above_top_bar').show();
jQuery('.extend_top_contact_info').show();
jQuery('#custom_logo img').removeClass('zoom');
jQuery('#custom_logo img').css('maxHeight', '');
jQuery('#custom_logo').css('marginTop', parseInt(logoMargin) + 'px');
jQuery('#menu_wrapper div .nav > li > a').css('paddingTop', menuPaddingTop + 'px');
jQuery('#menu_wrapper div .nav > li > a').css('paddingBottom', menuPaddingBottom + 'px');;
jQuery('.top_bar').removeClass('scroll');
jQuery('#post_info_bar').removeClass('scroll');
}
} else {
if (jQuery(this).scrollTop() >= 200) {
jQuery('.header_style_wrapper').addClass('nofixed');
} else {
jQuery('.header_style_wrapper').removeClass('nofixed');
}
}
});
});
更好地切换类(命名为象,滚动出)对身体并使用CSS来切换其他元素的可见性/行为。 –