Jump to content
Fórum Script Brasil
  • 0

Janela PopUnder com mais de um link


josealbinofn

Question

Seguinte galera... to fazendo uma janela popunder para meu site...

segue o codigo

addEvent = function (element, eventName, eventHandler) {
    if (element.attachEvent) {
        element.attachEvent("on" + eventName, eventHandler)
    } else if (element.addEventListener) {
        element.addEventListener(eventName, eventHandler, false)
    } else {
        var oldEvent = element["on" + eventName];
        element["on" + eventName] = function () {
            if (oldEvent) {
                oldEvent()
            }
            eventHandler();
            return true
        }
    }
};
var w = screen.availWidth;
var h = screen.availHeight;
var popunder="http://www.google.com"
var winfeatures="width="+w+",height="+h+",scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"
var once_per_session=0

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      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 loadornot(){
    if (get_cookie('popunder')==''){
            loadpopunder()
            document.cookie="popunder=yes"

    }
}

function loadpopunder(){
    win2=window.open(popunder,"",winfeatures)
    if (win2){
        win2.blur()        
    }
    
    
}


function inicio(){
     loadornot()
}

addEvent(document, "click", inicio);

Pois bem, como podem ver esse codigo ai abre uma pagina, apenas um link definido, no exemplo www.google.com,

Gostaria que ele abrisse mais de um link, ex: www.google.com, www.baixaki.com, www.g1.com, de maneira aleatoria, não ao mesmo tempo...

é possivel? alguém pode ajudar?

grato...

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...