1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resizing an iFrame after submit...

Discussion in 'Cloaking and Content Generators' started by Wizzoid, Apr 27, 2009.

  1. Wizzoid

    Wizzoid Registered Member

    Joined:
    Dec 16, 2008
    Messages:
    94
    Likes Received:
    22
    Hi Guys.. I was wondering how this is done.

    I've got an iframe on a page of mine, through a dmr it redirects to my fake referersite with CPA Redirector installed and from there to the offerpage.

    Now I want the iFrame to resize itself to 1x1 pixels once the visitor presses the sign up button. I'd appreciate any help.

    Thanks.
     
  2. Arthas

    Arthas BANNED BANNED

    Joined:
    Jan 5, 2009
    Messages:
    637
    Likes Received:
    322
    you have to use javascript that polls the browser history for changes. godcpa does this. you can buy it in the sales forum.
     
  3. Wizzoid

    Wizzoid Registered Member

    Joined:
    Dec 16, 2008
    Messages:
    94
    Likes Received:
    22
    Thanks for the info Arthas. I'm not looking to buy a script tho, I want to know what I'm doing before I start using scripts.

    How do I poll the browser history for changes? How should that javascript code look like?
     
  4. Arthas

    Arthas BANNED BANNED

    Joined:
    Jan 5, 2009
    Messages:
    637
    Likes Received:
    322
    heres an old snippet i found

    Code:
    <html>
    <head>
    
    <style>
    body {
    /*margin: 0px 0px 0px 0px;*/
    margin: 0px auto;
    }
    
    #outerdiv 
    { 
    width:430px;
    height:150px;
    overflow:hidden;
    position:relative;
    }
    
    #inneriframe 
    { 
    position:absolute; 
    top:-430px; 
    left:-430px; 
    width:1280px; 
    height:1200px; 
    } 
    </style>
    
    
    </head>
    <body>
    
    <script type="text/javascript">
    var oldHistLength = history.length;
    setInterval ("checkHistory()",1000);
    function checkHistory() {
    if (oldHistLength != history.length) {
    
      if (top.location != self.location) {
        //top.location = self.location.href
      }
      
    document.body.style.width="100%";
    document.body.style.height="100%";
        var o=document.getElementById("outerdiv");
        o.style.width ="100%";
        o.style.height ="100%";
        o.style.position ="absolute";
        o.style.top ="0px";
        o.style.left ="0px";
        o.style.border="none";
        o.style.overflow ="visible";
        o.style.margin="0px";
        var f=document.getElementById("inneriframe");
        f.style.width ="100%";
        f.style.height ="100%";
        f.style.position ="absolute";
        f.style.top ="0px";
        f.style.left ="0px";
        f.style.border="none";
        f.style.margin="0px";
        oldHistLength = history.length;
      }
    }
    </script>
    <div>
    <div id="outerdiv"><iframe id="inneriframe" src="http://google.com"></iframe></div>
    </div>
    
    </body>
    </html>
    
     
    • Thanks Thanks x 1
  5. Wizzoid

    Wizzoid Registered Member

    Joined:
    Dec 16, 2008
    Messages:
    94
    Likes Received:
    22
    Thanks. I'm still not sure how to implement this on my site, but I'll play around with it.
     
  6. BlackMelvyn

    BlackMelvyn Regular Member

    Joined:
    Jul 8, 2008
    Messages:
    202
    Likes Received:
    272
    Home Page:
    otherwise, just code a javascript function that will resize the iframe upon submission of the form.

    For example :
    HTML:
    <iframe id="the_iframe" width="100%" height="100%" frameborder="0" src="http://yourcpalink.tld/?affId=xxx000"></iframe>
    <form action="" method="post" onsubmit="resizeIfr()">
    	<fieldset>
    		<p><label for="">label</label><input type="text" value="something" name="someotherthing" /></p>
    		<p>etc....</p>
    	</fieldset>
    </form>
    <script type="text/javascript">
    function resizeIfr(){
    	document.getElementById('the_iframe').width = '1px';
    	document.getElementById('the_iframe').height = '1px';
    	//	If style attribute use following
    	document.getElementById('the_iframe').style.width = '1px';
    	document.getElementById('the_iframe').style.height = '1px';
    	return;
    }
    </script>
     
    • Thanks Thanks x 1
  7. Wizzoid

    Wizzoid Registered Member

    Joined:
    Dec 16, 2008
    Messages:
    94
    Likes Received:
    22
    Looks great Melvin. Thanks. I'm new to working with javascript, but I'll play around a bit with the 2 scripts. I really need to get this to work, got some great offers in my country which would give me big profit using this method.
     
  8. plunge

    plunge BANNED BANNED

    Joined:
    Dec 22, 2008
    Messages:
    162
    Likes Received:
    45
    The first snippet is the right angle, you need to poll the browser history and then make your changes to the iframe after it's changed.

    Record its' initial value (it's per tab/window) and then when it's +1, use the style property of the iframe to make your changes. You can also just make it completely hidden and it will still "be there", no need to go 1x1.
     
    • Thanks Thanks x 1
  9. Wizzoid

    Wizzoid Registered Member

    Joined:
    Dec 16, 2008
    Messages:
    94
    Likes Received:
    22
    What should I change in the first snippet?
     
  10. Wizzoid

    Wizzoid Registered Member

    Joined:
    Dec 16, 2008
    Messages:
    94
    Likes Received:
    22
    I'm pretty much lost now. I've got no idea on how to alter this script so it will poll the browserhistory and resize the iframe when the visitor has clicked the sign up button. Please take my by the hand and show me step by step. Would really appreciate it.
     
  11. spite42o

    spite42o Junior Member

    Joined:
    Jan 9, 2009
    Messages:
    183
    Likes Received:
    146
    Occupation:
    BHPimp
    Location:
    Your Moms House.
    then just spend the 250 and get GODcpa ;x it'll make its money back faster then you can say superfragilisticexpialidocious :rain::rain::rain: