1.A:Where is my pen,Martin?
B:Your pen?It must be in your pencil box.
2.A:How do you get to school?
B:Well...I usually walk,or ride my bike.But today,I took the bus.
3.A:Shall we go to the train station,now?It's seven thirty.
B:No hurry,we still have two hours left.
$.fn.smartFloat = function() {
var position = function(element) {
var top = element.position().top, pos = element.css("position");
$(window).scroll(function() {
var scrolls = $(this).scrollTop();
if (scrolls > top) {
if (window.XMLHttpRequest) {
element.css({
position: "fixed",
top: 0
});
} else {
element.css({
top: scrolls
});
}
}else {
element.css({
position: "relative",
});
}
});
};
return $(this).each(function() {
position($(this));
});
};
//绑定
$("#container").smartFloat();