Juice
Juice

Reputation: 3063

Iframe content is not coming in correct position when calling through script

I am developing a pay per click site. I have developed a script for publishers to show ads. When I put this script in any site, it's coming in a wrong position.

Script:

<script type="text/javascript">
var campaignid ="9RJNUW1";
var camp_id ="42";
var publisherid ="1350";
var width ="728";
var height ="90";
</script>

<script src="http://www.ayhanetwork.com/en/ad_code.js"></script>

But when I put the iframe (which is generated by the script ) is coming in the right position.

iframe:

<iframe scrolling="no" src="http://www.ayhanetwork.com/en/code.php?campaignid=9RJNUW1&amp;publisherid=1350&amp;width=728&amp;height=90&amp;camp_id=42" style="width: 748px; height: 110px; border: medium none; clear: both; position: static; bottom: 0px; left: 0px;"></iframe>

Site url where i placed my code

http://rapidsurfing.net/Gadget/

AND i would like to place my ad like this

I have checked this in WordPress site and in a Codeigniter site

enter image description here

And i would like to show my ads Like this

enter image description here

Any help will be highly appreciated

Upvotes: 0

Views: 177

Answers (1)

Khurram Ishaque
Khurram Ishaque

Reputation: 798

Well, you have to update your code in js file so that the iframe should be appended in the div which has class='ads'.. So, you can either use javascript or jquery to do so. And also position absolute should not be used in this case. it should be changed to position: relative.

Upvotes: 1

Related Questions