怎么才能在HTML中做个悬浮窗并在里面插个超链接。求代码

2025-03-31 10:29:54
推荐回答(3个)
回答1:

=========给你上传了附件,里面是源码,你去下载
在悬浮框里面加上超链接就行了
*{ padding:0px; margin:0px;}
.box{ width:1000px; background:#ccc; margin:0 auto; overflow:hidden;}
.main{ width:770px; height:2000px; background:#000; float:left;}
.sub{ width:220px; background:#FC6; float:right;}
.sub01{ width:220px; height:100px; background:#0CC; margin-bottom:10px;}
.fixed{ width:220px; height:300px; background:#F66; font:normal 13px/30px \5FAE\8F6F\96C5\9ED1; text-align:center; top:10px;}







悬浮框










我是悬浮框









$(document).ready(function(e) {
t = $('.fixed').offset().top;
mh = $('.main').height();
fh = $('.fixed').height();
$(window).scroll(function(e){
s = $(document).scrollTop();
if(s > t - 10){
$('.fixed').css('position','fixed');
if(s + fh > mh){
$('.fixed').css('top',mh-s-fh+'px');
}
}else{
$('.fixed').css('position','');
}
})
});

 

回答2:

999

回答3:

div➕a标签,自己css美化

相关问答
最新问答