//固定tag cloud
jQuery(
function
() {
//指定的高度,侧边栏距顶部距离+侧边栏高度+可视页面的高度
var
sideTop=jQuery(
"#sidebar"
).offset().top+jQuery(
"#sidebar"
).height()+jQuery(window).height();
var
scTop =
function
() {
if
(
typeof
window.pageYOffset !=
'undefined'
) {
return
window.pageYOffset;
}
else
if
(
typeof
document.compatMode !=
'undefined'
&& document.compatMode !=
'BackCompat'
) {
return
document.documentElement.scrollTop
}
else
if
(
typeof
document.body !=
'undefined'
) {
return
document.body.scrollTop;
}
}
jQuery(window).scroll(
function
() {
if
(scTop() > sideTop) {
if
(jQuery(
"#fixed-siderbar"
).length == 0){
//下面是要显示的模块,复制侧边栏中的标签云内容,追加到侧边栏的底部
var
tag = jQuery(
"#tag_cloud-2 .widget-wrap"
).clone().html();
var
html=
"<div id='fixed-siderbar'><div id='fixed-wrap'><div id='fixedTag' class='widget widget_tag_cloud' >"
+ tag +
"</div></div></div>"
jQuery(
"#sidebar"
).append(html);
}
else
{
jQuery(
"#fixed-siderbar"
).show();
}
}
else
{
jQuery(
"#fixed-siderbar"
).hide();
};
});
});