1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help to make an Iframe "float"

Discussion in 'Programming' started by Killzonevideos, Sep 26, 2016.

  1. #1
    Hi all,

    I have added and Iframe JS ad to one of my sites, but I need it to "float" in the current position when a user scrolls down the page.

    Thanks in advance for any help.

    Killzonevideos

    I forgot to add the code I have so far, here it is.


    <div id="juicyadsfloat" style=" 
        position:absolute; 
        width:306px;height:256px;top:415px;left:10px; 
        padding:15px;background:#FFFFFF; 
        border:0px solid #2266AA; 
        z-index:100"> 
    <iframe border=0 frameborder=0 marginheight=0 marginwidth=0 width=308 height=256 scrolling="no"
    allowtransparency="true" src="http://adserver.juicyads.com/adshow.php?adzone=529568"></iframe>
    <p align="right" style="margin-top:0px; margin-bottom:5px; margin-left:2px; margin-right:2px;"><a href="
    javascript:window.parent.document.getElementById('juicyadsfloat').parentNode.removeChild(window.parent.document.getElementById('juicyadsfloat'))" onclick="closebar(); return false"><strong><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Close [X]</font></strong></a></p>
    HTML:
     
    Last edited by a moderator: Sep 26, 2016
    Killzonevideos, Sep 26, 2016 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #2
    When you say float, I don't think you mean float. try position:fixed instead of absolute... THOUGH...

    I'd likely suggest losing the div for nothing around it, and for Christmas sake get the blasted style out of yer markup and put it in the external stylesheet where it belongs. Most of those 1997 style attributes should probably get the axe too...

    Though fixing an external advert on the page? WAY to piss off users.
     
    deathshadow, Sep 26, 2016 IP
  3. Killzonevideos

    Killzonevideos Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Thanks, I managed to get it on my own, was what you said. Very new to this, will clean up the rest of the code sometime today.
     
    Killzonevideos, Sep 27, 2016 IP