[HELP] How can i do sth like this?

Discussion in 'HTML & Website Design' started by G-hamsteR, Apr 24, 2008.

  1. #1
    Hello and thanks for your time reading this.

    If you visit this site here: http://toxic-wow.net/ , you will see that a banner appears and you can't click anywhere else, unless you vote or click the "Remind me in 10 minutes".

    How can i do sth like this? It's really important. I'm sure it's with Javascript. I have searched in many sites, but I didn't manage to make it work.

    Thanks again!
     
    G-hamsteR, Apr 24, 2008 IP
  2. tinner666

    tinner666 Peon

    Messages:
    334
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That's a trademark design for downloaders. Why would you want to run people FROM your site.
    I treated it normally and closed that browser and ran CCleaner to clear temp files. If you want to turn people from your site, just delete the domain you want people to stay away from.:)
     
    tinner666, Apr 24, 2008 IP
  3. G-hamsteR

    G-hamsteR Well-Known Member

    Messages:
    268
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #3
    Didn't understand your reply at all...

    I want my homepage to have sth like this. I mean when they visit the site, a window will appear and they will need to click in order to continue...
     
    G-hamsteR, Apr 24, 2008 IP
  4. pixeladd

    pixeladd Banned

    Messages:
    2,238
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yeh its javascript
    check the page source for some code

    sorry its so long but heres the code

    <script type="text/javascript" src="js/mootools.js"></script>
    
    <style type="text/css">
    <!--
    #apDiv1 {
    	position:absolute;
    	left:43px;
    	top:11px;
    	width:101px;
    	height:123px;
    	z-index:1;
    }
    -->
    </style>
    
    <script type="text/javascript">
    <!--
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    
    <script type="text/javascript">
    	window.addEvent('load', function(){
    		var Tips1 = new Tips($$('.Tips1'), {
    			maxTitleChars: 50
    		});
    		$('nav').getElements('li').each(function(el){
    			el.onmouseover = function(){ el.addClass('sfhover'); };
    			el.onmouseout = function(){ el.removeClass('sfhover'); };
    		});
    	});
    </script>
    </head>
    <script type='text/javascript'>
      var voteImage = new Asset.image('http://i223.photobucket.com/albums/dd34/aether666/banner.gif');
      var voteLinks = ['http://www.toxic-wow.net/pages.php?id=vote'];
      var voteNr = 1;
    
      var hiddenNodes = new Array();
    
      window.addEvent('load', function(){
          if(window.ie){
              $$('select').each(function(el){
                  hiddenNodes.push(el);
                  el.setStyle('visibility', 'hidden');
              });
          }
    
          var blackLayer = new Element('div', {
              'styles': {
                  'position': 'absolute',
                  'top': '0px',
                  'left': '0px',	
                  'width': window.getScrollWidth(),
                  'height': window.getScrollHeight(),
                  'background-color': '#000000',
                  'opacity': 0.7,
                  'z-index': 99998
              }
          }).injectInside(document.body);
          
          var voteContainer = new Element('div', {
              'styles': {
                  'position': 'absolute',
                  'top': ( window.getScrollTop() + ( window.getHeight() - voteImage.height ) / 2 ),
                  'left': ( window.getScrollLeft() + ( window.getWidth() - voteImage.width ) / 2 ),
                  'width': voteImage.width,
                  'background-color': '#000000',
                  'z-index': 99999
              }
          }).injectInside(document.body);
          
          var voteLink = new Element('a', {
              'href': voteLinks[voteNr - 1],
              'target': '_blank'
          }).injectInside(voteContainer);
          voteImage.setStyle('border', '1px solid #FFFFFF').injectInside(voteLink);
    
          var voteNumber = new Element('div', {
              'styles': {
                  'position': 'absolute',
                  'top': '0px',
                  'right': '0px',
                  'font-size': 14,
                  'font-weight': 'bold',
                  'color': '#FFFFFF',
                  'padding': '5px'
              }
          }).setText('').injectInside(voteContainer);
          
          var voteAbort = new Element('div', {
              'styles': {
                  'color': '#FFFFFF',
                  'cursor': 'pointer',
                  'text-align': 'center'
              }
          }).setText('Remind me in 10 minutes.').injectInside(voteContainer);
          
          voteAbort.addEvent('click', function(){
    					createCookie('vote', 'vote', '10');
              if(window.ie) hiddenNodes.each(function(el){ el.setStyle('visibility', ''); });
              blackLayer.remove();
              voteContainer.remove();
              window.removeEvents('scroll').removeEvents('resize');
              Garbage.trash([blackLayer, voteContainer]);
          });
          
          voteLink.addEvent('click', function(){
    					createCookie('vote', 'vote', '720');
              voteNr++;
              (function(){
                  if(voteNr > voteLinks.length){
                      if(window.ie) hiddenNodes.each(function(el){ el.setStyle('visibility', ''); });
                      blackLayer.remove();
                      voteContainer.remove();
                      window.removeEvents('scroll').removeEvents('resize');
                      Garbage.trash([blackLayer, voteContainer]);
                  }else{
                      voteLink.href = voteLinks[voteNr - 1];
                      voteNumber.setText('Click here to vote');
                  }
              }).delay(10);
          });
          
          window.addEvent('scroll', function(){
              voteContainer.setStyles({
                  'top': ( window.getScrollTop() + ( window.getHeight() - voteImage.height ) / 2 ),
                  'left': ( window.getScrollLeft() + ( window.getWidth() - voteImage.width ) / 2 )
              })
          });
          
          window.addEvent('resize', function(){
              blackLayer.setStyles({
                  'width': window.getScrollWidth(),
                  'height': window.getScrollHeight()
              });
              voteContainer.setStyles({
                  'top': ( window.getScrollTop() + ( window.getHeight() - voteImage.height ) / 2 ),
                  'left': ( window.getScrollLeft() + ( window.getWidth() - voteImage.width ) / 2 )
    PHP:
    have a look here http://mootools.net/ for some more info
     
    pixeladd, Apr 24, 2008 IP
  5. tinner666

    tinner666 Peon

    Messages:
    334
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I mean it's often seen as a ploy to get somebody to click and accept a virus. Not saying you want to do that. Most people get a page like that, they navigate away from it. Like I did when I went to that link.

    I, for one, won't click that thing. Lots of people won't.

    But,:), it's your site and I feel you should do it the way you want it. :)
     
    tinner666, Apr 24, 2008 IP
  6. G-hamsteR

    G-hamsteR Well-Known Member

    Messages:
    268
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #6
    Thanks a lot for your help, but i still can't get it work..

    You may have some mistakes, kile what's this src="js/mootools.js" in the first line? I don't have this mootools.js...
    Is it possible to make an index.php that will have just this code working and when i open it it will ask me to press sth in order to continue?

    It just needs to have the code.

    Thanks again guys
     
    G-hamsteR, Apr 24, 2008 IP
  7. G-hamsteR

    G-hamsteR Well-Known Member

    Messages:
    268
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #7
    Made it work :D

    Really thanks for your help!!!!
     
    G-hamsteR, Apr 24, 2008 IP
  8. niceace

    niceace Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    It'd be nice if you responded to my PM,post and email. A yes or no would suffice instead my offer being ignored. Someone who is offering you money for a product shouldn't be treated that way.
     
    niceace, Apr 28, 2008 IP