我想要像
http://www.sd-sn.com/?gallery-13-grid.html
这个页面右边的客服浮动效果谢谢
以下是测试HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://shop.zhiliansoft.com/js/jquery-1.3.2.1.min.js"></script> <script type="text/javascript">
; (function($) {
$.fn.extend({
"followDiv": function(str) {
var _self = this;
var pos;
switch (str) {
case "left":
pos = { "left": "0px", "top": "180px" };
break;
}
/*FF和IE7可以通过position:fixed来定位,*/
// _self.css({ "position": "fixed", "z-index": "9999" }).css(pos);
/*ie6需要动态设置距顶端高度top.*/
// if ($.browser.msie && $.browser.version == 6) {
_self.css('position', 'absolute');
$(window).scroll(function() { topIE6 = parseInt(pos.top) + $(window).scrollTop();
_self.css('top', topIE6);
});
// }
return _self; //返回this,使方法可链。
}
});
})(jQuery);
$(document).ready(function() {
$('#div1').followDiv("left");
});
</script></head>
<body>
<div style="width: 100%; height: 600px;">
test</div>
<div id="div1">
我是客服
</div>
<div style="width: 100%; height: 600px;">
test</div>
</body>
</html>
http://www.sd-sn.com/?gallery-13-grid.html
这个页面右边的客服浮动效果谢谢
以下是测试HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://shop.zhiliansoft.com/js/jquery-1.3.2.1.min.js"></script> <script type="text/javascript">
; (function($) {
$.fn.extend({
"followDiv": function(str) {
var _self = this;
var pos;
switch (str) {
case "left":
pos = { "left": "0px", "top": "180px" };
break;
}
/*FF和IE7可以通过position:fixed来定位,*/
// _self.css({ "position": "fixed", "z-index": "9999" }).css(pos);
/*ie6需要动态设置距顶端高度top.*/
// if ($.browser.msie && $.browser.version == 6) {
_self.css('position', 'absolute');
$(window).scroll(function() { topIE6 = parseInt(pos.top) + $(window).scrollTop();
_self.css('top', topIE6);
});
// }
return _self; //返回this,使方法可链。
}
});
})(jQuery);
$(document).ready(function() {
$('#div1').followDiv("left");
});
</script></head>
<body>
<div style="width: 100%; height: 600px;">
test</div>
<div id="div1">
我是客服
</div>
<div style="width: 100%; height: 600px;">
test</div>
</body>
</html>
而那人SHOPEX的就比较平滑的移动到相应的位置
谢谢
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://shop.zhiliansoft.com/js/jquery-1.3.2.1.min.js"></script> <script type="text/javascript">
; (function($) {
$.fn.extend({
"followDiv": function(str) {
var _self = this;
var pos;
switch (str) {
case "left":
pos = { "left": "0px", "top": "180px" };
break;
}
/*FF和IE7可以通过position:fixed来定位,*/
// _self.css({ "position": "fixed", "z-index": "9999" }).css(pos);
/*ie6需要动态设置距顶端高度top.*/
// if ($.browser.msie && $.browser.version == 6) {
_self.css('position', 'absolute');
$(window).scroll(function() { topIE6 = parseInt(pos.top) + $(window).scrollTop();
//_self.css('top', topIE6);
$(_self).stop().animate({top:topIE6},500)
});
// }
return _self; //返回this,使方法可链。
}
});
})(jQuery);
$(document).ready(function() {
$('#div1').followDiv("left");
});
</script></head>
<body>
<div style="width: 100%; height: 600px;">
test</div>
<div id="div1">
我是客服
</div>
<div style="width: 100%; height: 600px;">
test</div>
</body>
</html>
$(_self).stop().animate({top:topIE6},500)加个动画的效果,后面的500自己可以调
不知道LZ说的平滑是不是指这个.