1
qiuai 2012-03-11 19:42:04 +08:00
<div class="sidebar"><span data-status="true" class="ui_bbr5 fl mbm hide" style="display: inline;"><a onclick="Fan.utility.addFavorite('', 'http://www.fandongxi.com');" class="fl c_grey1 bgc" href="javascript:;"><i class="sp_icos sp_icos_fav pngfix"></i>收藏</a></span><span data-status="true" class="ui_bbr5 fl hide" style="display: inline;"><a onclick="(function(){$(document).scrollTop(0);})()" class="fl c_grey1 bgc top" href="javascript:;"><i class="sp_icos sp_icos_top pngfix"></i>回顶部</a></span></div>
|
6
joynic OP <div class="addfav" id="goTopButton" style="display:none"><span class="ui_bbr5 fl hide" style="display:inline"><a onClick="window.external.AddFavorite(location.href, document.title);" class="fl" href="javascript:;"><i class="sp_icos sp_icos_fav"></i>收藏</a></span><span class="ui_bbr5 mbm fl hide" style="display:inline"><a class="fl" href="javascript:;"><i class="sp_icos sp_icos_top"></i>回到顶部</a></span></div>
<script type="text/javascript"> (function($){ $('#goTopButton').click(function(event){ $('html, body').animate({scrollTop:0}, 300); }); $(window).scroll(function(event){ if($(this).scrollTop() > 0){ if($.browser.ie6){ $('#goTopButton').css('top', $(this).scrollTop() + $(this).height() - 170); } if($('#goTopButton').css('display') == 'none'){ $('#goTopButton').fadeIn(); } }else{ $('#goTopButton').fadeOut(); } //顶部消息框位置 var dis = 10 - $(this).scrollTop(); if( 0<dis && dis<=10 ){ $("#headerimg").css("top",dis+"px"); }else{ $("#headerimg").css("top","0"); } }); })(jQuery); </script> 点击收藏,同样也回到顶部。什么原因呢? |