content="http://www.17173.comΩ/img/att_20070428184031359_Thu.jpgΩ100Ω100Ω163Ω160Ω600Ω100Ω100";
 quan=1  
//第三次传进来的广告   
content="http://www.baidu.comΩ/img/att_20070428184031359_Thu.jpgΩ200Ω200Ω163Ω260Ω400Ω200Ω200";
quan=2
 //第二次传进来的广告         
          
content="http://www.sohu.comΩ/img/att_20070428184031359_Thu.jpgΩ150Ω200Ω9999Ω120Ω300Ω100Ω200";
quan=1
//第一次传进来的广告
          
  this.sarray=new Array();   
  sarray=content.split('Ω');
      
 this.ADurl=sarray[0]; 
 this.imgsrc= sarray[1]; 
 this.ADheight=sarray[2]; 
 this.ADwidth= sarray[3]; 
 this.ADalt=sarray[4]; 
 this.Zonewidth=sarray[5]; 
 this.Zoneheight=sarray[6]; 
 this.Zonetop=sarray[7]; 
 this.Zoneleft=sarray[8]; 
function openwin()

openwindow=window.open("","","width="+Zonewidth+",height="+Zoneheight+",top="+Zonetop+",left="+Zoneleft+"") 
openwindow.document.write("<a href="+ADurl+"><img src="+imgsrc+" alt="+ADalt+" width="+ADwidth+" height="+ADheight+" /></a>") 

function get_cookie(Name) { 
var search = Name + "=" 
var returnvalue = ""; 
if (document.cookie.length > 0) { 
offset = document.cookie.indexOf(search) 
if (offset != -1) { 
offset += search.length 
end = document.cookie.indexOf(";", offset); 
if (end == -1) 
end = document.cookie.length; 
returnvalue=unescape(document.cookie.substring(offset, end)) 


return returnvalue; 
} function loadpopup(){ 
if (get_cookie('popped')==''){ 
openwin() 
document.cookie="popped=yes" 


loadpopup()想利用quan的数值大小做随机显示,速度来指点,我头脑已经茫然了,能在我的基础上改的最好

解决方案 »

  1.   

    梅子 写了个你试试,好用不,就是csdn上的那个.
      

  2.   

    有问题么?
    Math.floor(Math.random()*3)
    随机得到0 1 2 3
      

  3.   

    我记得.NET自己有个这样的插件,试试
      

  4.   

    没玩过,不是很清楚,
     foyuan(暴走零零漆) ( ) 信誉:98  2007-08-16 10:16:40  得分: 0  
     
     
       有问题么?
    Math.floor(Math.random()*3)
    随机得到0 1 2 3
      我就是在想如何把他传来的第一个值看成一个整体,第2个又是一个,因为他们的content,quan是一样的 就是不知道怎么搞了 迷茫 分不清谁是谁的quan
     
      

  5.   

    JS
    后载入document.createElment 一个 Script  Elment然后把这个 Append 到 Head 中.
    再触发一下 JS 文件中的调用函数即可....
      

  6.   

    实验了几次,取的随机数弹出的都是最后一次的广告窗口,怎么样把他一个广告作为一个整体(3个广告就是3个整体),然后找3个quan中数字最大的,随机得值,再找与得到的随机数想同得quan,就调那个quan所在的整体,
      

  7.   

    有没人帮忙解决一下,不用想太复杂了,就在我的基础上加吧,怎么做成一个数组(传来的一个广告参数),判断里面的最大的quan,做随机数,对比与随机数想进的就取该数组里面的值显示