无论网只能怎么上下拉滚动条这个 图片都紧紧的漂浮在网站最底下面这样的效果怎么做呢
解决方案 »
- window.open出现的疑难问题
- jquery怎么停止正在请求的ajax
- 表格拖动的问题
- filter:alpha的问题
- 控制图片尺寸的问题
- 找个成熟的美工做个网站,有诚意的请留下联系方式
- 急,梅花雨中控件在 XP 中执行报错,问题为<span Author=meizz id=meizzYearHead>中,meizzYearHead 不是对象,我的问题是SPAN 是什么东
- 这个导航栏效果,怎么实现?
- 太急了,请帮忙:父帧中重定向到其中的一个子帧问题,请来看看帮忙一下
- 如何控制整个页面上全部控件的有效性?
- 怎样用JS在chrome浏览器上悬停取词,求大神帮帮忙
- 怎么在chrome浏览器下获得鼠标的坐标??急急急!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css" >
/*Make position:fixed work in IE6!*/
.fixed-bottom /* position fixed Bottom */{position:fixed;bottom:0;top:auto;}
* html,* html body /* IE6 Fixed Position Jitter Fix */{background-image:url(about:blank);background-attachment:fixed;}
* html .fixed-bottom /* IE6 position fixed Bottom */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));} </style>
</head>
<body><div style="height:2000px;"></div>
<img src="images/test2.jpg" class="fixed-bottom" />
</body>
</html>
//$(window):浏览器对象
//$(document.body):body对象
//$(document):文档对象
(function($){// 拓展自jQuery
$.extend({// 静态方法写法(自定义一个叫osiris的类,避免与jQuery自身方法重名)
osiris : {
setTopRight : function($this){
$this.css({"display": "block", "position": "absolute", "text-align": "right"})
.animate( {
left : $(window).width() - $this.width()
}, 0)
$(window).scroll(function(){
$this.animate( {
top : $(document.body).scrollTop(),
left : $(window).width() - $this.width() + $(document.body).scrollLeft()
}, 0);
}).resize(function(){
$this.animate( {
left : $(window).width() - $this.width()
}, 0);
});
}
}
});
$.fn.extend({// 实例方法写法(这个我不会用自定义类的方法写成可以像“$(selector).osiris.setTopRight()”这样调用,会的同学欢迎提意见)
setTopRight : function(){
var $this =$(this);
$this.css({"display": "block", "position": "absolute", "text-align": "right"})
.animate( {
left : $(window).width() - $this.width()
}, 0)
$(window).scroll(function(){
$this.animate( {
top : $(document.body).scrollTop(),
left : $(window).width() - $this.width() + $(document.body).scrollLeft()
}, 0);
}).resize(function(){
$this.animate( {
left : $(window).width() - $this.width()
}, 0);
});
}
});
})(jQuery);// 调用方法
$(document).ready(function(){
//$("#topRight").setTopRight(); //(1)实例方法,自身调用
$.osiris.setTopRight($("#topRight")); //(2)静态方法,调用jQuery的自定义类osiris里面的静态方法
})// 用法:控件的直接parent标签必须是body,貌似是吧……
<body>
<div id="topRight" style="width:100px; position: absolute;">topRight</>
</body>//用animate是因为我的浏览器ie8用offset()只能取值却改不了值,暂时不知道为啥……
我的图片文件名在那里修改 放到index.htm主页里的代码是 最下面的那行吗?
position:fixed;
bottom:0;