日期:2014-05-17  浏览次数:20748 次

web开发,求思路。
网页右下角的小广告怎么做的,广告是否弹出需要根据查询数据库中表的一个字段确定。我现在思路是界面加载时候发送个ajax请求,去数据库中查询字段值,判断是否弹出小广告。完事那个小广告界面一点点升起就不会写了。这个小广告要咋写?求大神指点一下。还是我思路有错误的地方也可指点下,不胜感激。如果能给个小例子,就更好了。
java javaweb

------解决方案--------------------

<body onresize="changeSize()">
<div id="popup" style="background:#DDFFFF; display: block;bottom: 3px;right: 4px;z-index: 1000; position: fixed;width: 150px; height:120px; ">
弹出内容
</div>
</body>
<script type="text/javascript">
var oPopup = document.getElementById('popup');
var popTop=10;
var winHeight = 0;
var winWidth = 0;
var wdleft = 0;
var wdtop = 0;
function popshow(){
wdleft = window.self.screenLeft;
wdtop = window.self.screenTop;
if(popTop<180){
if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth) {
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}
oPopup.style.posLeft=winWidth -150;
oPopup.style.posTop=winHeight;
}else if(popTop<220){
wdleft = window.self.screenLeft;
wdtop = window.self.screenTop;
if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth) {
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}
oPopup.style.posLeft=winWidth -150; 
oPopup.style.posTop=winHeight - popTop + 90;
}else if(popTop<220){

}
popTop+=10;
var mytime=setTimeout("popshow();",50);
}
popshow();

function changeSize() {
if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth) {
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}
oPopup.style.posLeft=winWidth - 150; 
oPopup.style.posTop=winHeight- 120;
}
</script>

------解决方案--------------------

 
<!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> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<title>右下角弹出框</title> 
</head> 
<style type="text/css"> 
#rbbox{position:absolute;right:0;bottom:0;width:300px;height:0px;overflow:hidden} 
.button{display:inline;float:right;font-size:12px;cursor:pointer} 
</style>