您的位置:程序门 -> web 开发 -> asp



史上最难解决的asp对联广告调用问题,从qq 中的asp群再次找到这里来寻找帮助!请求高手指点!


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


史上最难解决的asp对联广告调用问题,从qq 中的asp群再次找到这里来寻找帮助!请求高手指点!
发表于:2007-08-11 19:53:05 楼主

  目前我的问题是这样的:一般大型的网站首页左右两边都有对联广告,现在我想通过后台数据库中调用广告列表,来显示这个广告,而不是简单的修改广告的名称!也就

是首页看到的广告是动态可以提交的!随着用户的上传而决定这个广告的内容!我的网站首是静态生成的后辍名为index.html,
代码如下:
<html>
<head>
<title> 网站首页 </title>
<meta   http-equiv= "content-type "   content= "text/html;   charset=gb2312 ">
<body>
</body>
</html>

而我的对联广告显示是float.asp文件如:

<!--#include   file= "../incfiles/conn.asp "-->   这个包含文件是链接数据库文件
<script   language= "javascript ">
<%set   rsad=server.createobject( "adodb.recordset ")
rsad.open   "select   top   1   *   from   r_ad_list   left   join   r_ad_sort   on   (r_ad_list.a_sortid=r_ad_sort.id)   where   r_ad_sort.id=16   and   a_typeid=1  

",conn,1,1
%>
var   delta=0.8;
var   collection;
var   closeb=false;
function   floaters()   {
this.items =   [];
this.additem =   function(id,x,y,content)
    {
document.write( ' <div   id= '+id+ '   style= "z-index:   10;   position:   absolute;     width:80px;   height:60px;left: '+

(typeof(x)== 'string '?eval(x):x)+ ';top: '+(typeof(y)== 'string '?eval(y):y)+ ' "> '+content+ ' </div> ');

var   newitem =   {};
newitem.object =   document.getelementbyid(id);
newitem.x =   x;
newitem.y =   y;

this.items[this.items.length] =   newitem;
    }
this.play =   function()
    {
collection =   this.items
setinterval( 'play() ',30);
    }
}
function   play()
{
if(screen.width <=800   ¦ ¦   closeb)
{
for(var   i=0;i <collection.length;i++)
{
collection[i].object.style.display =   'none ';
}
return;
}
for(var   i=0;i <collection.length;i++)
{
var   followobj =   collection[i].object;
var   followobj_x =   (typeof(collection[i].x)== 'string '?eval(collection[i].x):collection[i].x);
var   followobj_y =   (typeof(collection[i].y)== 'string '?eval(collection[i].y):collection[i].y);

if(followobj.offsetleft!=(document.body.scrollleft+followobj_x))   {
var   dx=(document.body.scrollleft+followobj_x-followobj.offsetleft)*delta;
dx=(dx> 0?1:-1)*math.ceil(math.abs(dx));
followobj.style.left=followobj.offsetleft+dx;
}

if(followobj.offsettop!=(document.body.scrolltop+followobj_y))   {
var   dy=(document.body.scrolltop+followobj_y-followobj.offsettop)*delta;
dy=(dy> 0?1:-1)*math.ceil(math.abs(dy));
followobj.style.top=followobj.offsettop+dy;
}
followobj.style.display =   ' ';
}
}
function   closebanner()
{
closeb=true;
return;
}

var   thefloaters =   new   floaters();
thefloaters.additem( 'followdiv1 ', 'document.body.clientwidth-106 ',0, ' <a   href= <%=rsad( "a_website ")%> > <img   src=../ad/ad/ <%=rsad( "a_pic ")%>  

width=100   height=215   border=0> </a> ');
thefloaters.additem( 'followdiv2 ',6,0, ' <a   href= <%=rsad( "a_website ")%> > <img   src=../ad/ad/ <%=rsad( "a_pic ")%>   width=100   height=215  

border=0> </a> ');
thefloaters.play();
document.write   ( " "+thefloaters+ " ")
<%
rsad.close:set   rsad=nothing
%>
</script>


我先在就是无法实现这个对联广告在首页的包含,如果不使用后台数据库表中的数据调用,直接用一个实实在在的动画或图片做为对联广告,那么就可以直接将这些代码放

进去,能正常!但目前就是不能实现从静态页面中调用,有朋友也告诉我用框架去包含如:
<iframe   scrolling= "no "   frameborder= "0 "   height= " "   width= " "   src= "float.asp "> </iframe>
但还是没用只是在首页最上方有个空白处,去无法实现窗口的左右分列排!这个问题我也问了好多qq群中的asp相关人员,但都没有解决,所以最后我想到了中国it技术交

流社区,希望有高手在此能帮我解决这个问题!前提是我的首页必须是静态生成的,如果有更好的解决方案请与我联系:qq:361796232   在此感谢大家的帮助!谢谢
发表于:2007-08-11 20:18:431楼 得分:0
实在是太难了,我无法解决,我相信有高手会解决的!
发表于:2007-08-11 20:24:272楼 得分:0
js调用吧
发表于:2007-08-11 20:27:363楼 得分:0
使用js调用,但无法从数据库中调用呀!因为js不能写类似asp的语呀!谢谢你了!不过你说的调用又是哪种呀?请指教!谢谢!在线等待,,
发表于:2007-08-11 20:32:454楼 得分:0
iframe   ,左中右结构,应该可以的。

大概语句:
<frameset   cols=10,*,10,     ...>

<iframe   > <iframe/>

<iframe> </iframe>

<iframe> </iframe>


</frameset>
发表于:2007-08-11 20:50:225楼 得分:0
或者我们也可以将问题简单话,先做第一步:如保通过数据调用,显示对联广告!先不从这个页面放在index.html   文件中,看看float.asp是否有问题,如里所以都不考虎,不从数据库中调用,不放在index.html,那剩余的代码是可以实现首页对联广告的!但不是我最终要得结果,。。。。刚才这位好心人能否说得具体点!谢谢!
发表于:2007-08-12 18:02:426楼 得分:0
不知可否使用层来做呢?对联广告是最上面的层,其他的是对联广告层下面的层。这样可否?
发表于:2007-08-12 21:26:467楼 得分:0
将首页文件后缀改为.asp,不知可否。也不知楼主的意思是不是不能改。
发表于:2007-08-12 21:31:008楼 得分:0
看了楼主的前提了。
用js调用试试,js可以用asp语句的。
js文件:

js变量= "asp语句 "
document.write   变量

静态页调用文件:
<script   language= "javascript "   src= "js文件名 "> </script>


快速检索

最新资讯
热门点击