我在一段时间前就发现了这一点,现在我可以这样做。 我想找到一些东西,如pple店的购物车,它带有一小块,没有固定的绝对位置,例如,我要说,它坐在屏幕的中心,而只有当你 s下时,它只能走到浏览器头的人的边境......。
我不敢确定一米是否清晰。 我进行了搜身,但我发现的是 c的位置。
你们能否帮助我,或者说什么?
最佳方面
我在一段时间前就发现了这一点,现在我可以这样做。 我想找到一些东西,如pple店的购物车,它带有一小块,没有固定的绝对位置,例如,我要说,它坐在屏幕的中心,而只有当你 s下时,它只能走到浏览器头的人的边境......。
我不敢确定一米是否清晰。 我进行了搜身,但我发现的是 c的位置。
你们能否帮助我,或者说什么?
最佳方面
仓库使用以下设备:
div.cto div.slider-content {
height: 100%;
overflow: visible;
padding-bottom: 20px;
position: absolute;
right: 0;
top: -10px;
width: 169px;
}
div.cto div.pinned_top div#secondary {
position:absolute;top:0;right:0;
}
div.cto div.floating div#secondary {
position:fixed;top:0;
}
用javascript的话来说,干.的类别从胎头换成滚动。
About:
$( html ).scrollTop()
这份备忘录确切表明,你正在寻求:
这里是指与杂草的关联:
https://github.com/bigspotteddog/ScrollToFixed”rel=“nofollow”https://github.com/bigspotteddog/ScrollToFixed
我假设你的话是,你“......没有机会来证明这一点”,因为你不知道 j。 如果我错了,请让我说。 页: 1
Here is the usage:
<head>
<script src="scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="scripts/jquery-scrolltofixed.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$( #cart ).scrollToFixed({ marginTop: 10 });
});
</script>
</head>
对你指定的内容作准。
May be it is helpful to you.
This is new approach with css3. use position:sticky
to follows the scroll.
Here is the article explained.
http://updates.html5rocks.com/2012/08/Stick-your-landings-position-sticky-lands-in-WebKit
http://jsbin.com/omanut/2“rel=“nofollow”
The problem is with those divs that have height greater than the visible area height.
So I wrote the script below.
Put the sidebar id that you want and the id of the div that will stop the div following, like the footer.
You will notice how useful this function is if the div has greater height than the window.
I don t know why, but it works great only as inline javascript, not external.
$(function () {
var $sidebar = $("#sidebar"),
$window = $(window),
offset = $sidebar.offset(),
topPadding = 5,
$stopelement = $("#footer");
var lastScrollTop = 0;
$window.scroll(function () {
if ($window.width() > 750) {
if ($window.scrollTop() > lastScrollTop) {
//down
var addtotopposition = ($window.scrollTop() + $window.height()) - ($sidebar.height() + offset.top) + topPadding;
if ($window.scrollTop() + $window.height() > offset.top + $sidebar.height()) {
if (offset.top + addtotopposition + $sidebar.height() < $stopelement.offset().top) {
$sidebar.stop().animate({
marginTop: addtotopposition
});
}
} else {
$sidebar.stop().animate({
marginTop: 0
});
}
} else {
//up
var offset_top = offset.top + parseInt($sidebar.css("margin-top"));
//console.log(offset_top + " + " + topPadding + ">" + $window.scrollTop());
if (offset_top + topPadding > $window.scrollTop()) {
var addtotopposition = Math.max($window.scrollTop() - offset.top + topPadding, 0);
//console.logconsole.log(offset_top + "-" + addtotopposition + ">0");
if (offset_top - addtotopposition > 0) {
$sidebar.stop().animate({
marginTop: addtotopposition
});
} else {
$sidebar.stop().animate({
marginTop: 0
});
}
}
}
} else {
$sidebar.stop().animate({
marginTop: 0
});
}
lastScrollTop = $window.scrollTop();
});
});
I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....
I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.
selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...
How do you target specifically safari in css with styles?
Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...
So I ve got a menu with a hover/selected state and it loads fine in IE6/IE7. However when I scroll down the page and put the element outside of the viewport and then back in I get a broken image! I ...
I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...
I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...