- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试使用 ScrollToFixed 进行简单的固定滚动, 但我遇到了一些奇怪的行为
我准备了一个jsfiddle显示出以下问题:
html:
<div class="row-fluid">
<div id="car_left_col" class="span2">left</div>
<div id="car_center" class="span8">
<div class="car_main thumbnail">
<div class="car_cover">
<img alt="" src="http://www.autopulze.com/wp-content/uploads/2012/07/Rolls-Royce-Silver-Ghost-the-Best-Car-in-the-World.jpg">
</div>
<hr>
<div class="car_page_creator"></div>
</div>
<div class="car_talk">here are the comments for the car</div>
</div>
<div id="car_right_col" class="span2">
<div class="car_vote test_fixed">I should not move</div>
</div>
<div class="long"></div>
CSS:
.long {
height: 10000px;
}
#car_right_col {
position: relative;
}
.car_main {
position: relative;
padding: 0;
}
.car_cover {
width: 100%;
position: relative;
}
.car_cover img {
width: 100%;
}
.test_fixed {
position: static;
}
.car_vote {
position: relative;
}
js:
$(document).ready(function () {
$('.test_fixed').scrollToFixed({
marginTop: 45,
limit: $('.car_page_creator').offset().top
});
});
.test-fixed
在向下滚动时具有非常大的 left
属性<我认为我的 html 和 css 非常标准,没有什么特别之处。这种行为是由于我的代码还是插件中的错误造成的?
最佳答案
我已经为你更新了你的 fiddle :
http://jsfiddle.net/kspA8/17/embedded/result/
.test_fixed {
position: static;
left: auto !important;
}
将 auto left 属性应用于您的上下文元素似乎已经修复了它:)
关于javascript - scrollToFixed - 奇怪的滚动问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16898629/
如果我使用函数中的 scrolltofixed 插件调用页脚的限制,我会遇到一个奇怪的问题。 由于页脚和动态内容存在其他问题,我已经在限制下进行了此解决方法。 这里是 original fiddle
该问题在每个浏览器中的表现都不同,例如在 Firefox 中大约一个空格如果您再次滚动到顶部,则会出现具有相同高度的滚动框。在 chrome 中,滚动时框会变得狭窄等等...... 使用的调用是:
我对 scrollToFixed 脚本有疑问。 https://github.com/bigspotteddog/ScrollToFixed这是一个案例:http://dash.com.pl/CTP/
我正在尝试使用一个名为 scrollToFixed 的插件修复滚动条上的标题,就像 iOS 联系人列表一样。不过,我看不出如何使 header (.learning-objective-header)
我正在尝试使用 ScrollToFixed 进行简单的固定滚动, 但我遇到了一些奇怪的行为 我准备了一个jsfiddle显示出以下问题: html: left
jquery scrollToFixed 在到达页面最顶部时停止,它只是出现在本应固定在最顶部的 div 的顶部。 Here is what I have so far . var arr = new
遇到涉及开发中站点的问题。其中一个页面集成了一个 wordpress 博客。我已经 scrolltofixed 运行,但问题是在博客页面上,菜单的高度比我的其他页面(没有 wordpress)高。 (
我正在尝试让滚动跟随 ScrollToFixed.js 这是我的观点: Summary 1
无论我做什么,我似乎都无法让 scrolltofixed 代码在我的 tumblr 页面上工作。我看过here和 here ,但似乎没有任何效果。我的 tumblr 页面是 http://htmlte
我在使用 scrolltofixed jquery 插件时遇到问题 https://github.com/bigspotteddog/ScrollToFixed 我使用: $('#tostick').
我使用 ScrollToFixed 非常成功,但有一个问题。我的内容中有一个正在扩展的 div,如果展开该 div,scrollToFixed 端点不会动态增加以适应新的高度。 因此,端点仍然固定在扩
我正在使用 scrollToFixed用于固定 div 位置的插件。这是我正在使用的 html 代码 和CSS *{
我们正在使用 jQuery Mobile、Bootstrap 3、scrollToFixed。我们已经建立了一个几乎可以满足我们需要的工作页面,但是,我们无法让选项卡内容向上滚动。 我们在此处包含了
我是一名优秀的程序员,十分优秀!