Announcement

Collapse
No announcement yet.

How can i put a fixed div with an Image 'under' the forums part.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • FrozrnGod
    replied
    Common guys,
    No one can help?

    Leave a comment:


  • FrozrnGod
    replied
    Originally posted by webmastersun View Post

    Hi,

    Here's the codes
    Code:
    <div id="divAdRight" style="display: block; position: fixed; top: 0px;"> <a href="http://www.yourdomain.com"><img src="http://www.youdomain.com/yourfile.jpg" width="125" /></a> </div> <div id="divAdLeft" style="display: block; position: fixed; top: 0px;"> <a href=" http://www.yourdomain.com"><img src="http://www.youdomain.com/yourfile.jpg" width="125" /></a> </div>
    
    <script> function FloatTopDiv() { startLX = ((document.body.clientWidth -MainContentW)/2)-LeftBannerW-LeftAdjust , startLY = TopAdjust+80; startRX = ((document.body.clientWidth -MainContentW)/2)+MainContentW+RightAdjust , startRY = TopAdjust+80; var d = document; function ml(id) { var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; el.sP=function(x,y){this.style.left=x + 'px';this.style.top=y + 'px';}; el.x = startRX; el.y = startRY; return el; } function m2(id) { var e2=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; e2.sP=function(x,y){this.style.left=x + 'px';this.style.top=y + 'px';}; e2.x = startLX; e2.y = startLY; return e2; } window.stayTopLeft=function() { if (document.documentElement && document.documentElement.scrollTop) var pY = document.documentElement; else if (document.body) var pY = document.body; if (document.body.scrollTop > 30){startLY = 3;startRY = 3;} else {startLY = TopAdjust;startRY = TopAdjust;}; ftlObj.y += (pY+startRY-ftlObj.y)/16; ftlObj.sP(ftlObj.x, ftlObj.y); ftlObj2.y += (pY+startLY-ftlObj2.y)/16; ftlObj2.sP(ftlObj2.x, ftlObj2.y); setTimeout("stayTopLeft()", 1); } ftlObj = ml("divAdRight"); //stayTopLeft(); ftlObj2 = m2("divAdLeft"); stayTopLeft(); } function ShowAdDiv() { var objAdDivRight = document.getElementById("divAdRight"); var objAdDivLeft = document.getElementById("divAdLeft"); if (document.body.clientWidth < 1000) { objAdDivRight.style.display = "none"; objAdDivLeft.style.display = "none"; } else { objAdDivRight.style.display = "block"; objAdDivLeft.style.display = "block"; FloatTopDiv(); } } </script> <script> document.write("<script type='text/javascript' language='javascript'>MainContentW = 1000;LeftBannerW = 125;RightBannerW = 125;LeftAdjust = 5;RightAdjust = 5;TopAdjust = 10;ShowAdDiv();window.onresize=ShowAdDiv;;<\/script>"); </script>
    You will need to replace your images and your ULR into codes above.

    Cheers,
    Hey,
    Can you please point me in which template this code should go?
    Thanks.

    Leave a comment:


  • webmastersun
    replied
    Originally posted by FrozrnGod View Post
    Hey guys,
    So what I want to achieve is that I will have 2 graphics of Heroes standing on both side of the main page forums part.
    After some thinking this can not be achieved with just changing the background so I have the Image which is 1612x497 and I want it to appear at the vertical middle of the screen on the forum homepage.

    How can i do that? Thanks!
    Hi,

    Here's the codes
    Code:
    <div id="divAdRight" style="display: block; position: fixed; top: 0px;"> <a href="http://www.yourdomain.com"><img src="http://www.youdomain.com/yourfile.jpg" width="125" /></a> </div> <div id="divAdLeft" style="display: block; position: fixed; top: 0px;"> <a href=" http://www.yourdomain.com"><img src="http://www.youdomain.com/yourfile.jpg" width="125" /></a> </div>
    
    <script> function FloatTopDiv() { startLX = ((document.body.clientWidth -MainContentW)/2)-LeftBannerW-LeftAdjust , startLY = TopAdjust+80; startRX = ((document.body.clientWidth -MainContentW)/2)+MainContentW+RightAdjust , startRY = TopAdjust+80; var d = document; function ml(id) { var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; el.sP=function(x,y){this.style.left=x + 'px';this.style.top=y + 'px';}; el.x = startRX; el.y = startRY; return el; } function m2(id) { var e2=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; e2.sP=function(x,y){this.style.left=x + 'px';this.style.top=y + 'px';}; e2.x = startLX; e2.y = startLY; return e2; } window.stayTopLeft=function() { if (document.documentElement && document.documentElement.scrollTop) var pY = document.documentElement; else if (document.body) var pY = document.body; if (document.body.scrollTop > 30){startLY = 3;startRY = 3;} else {startLY = TopAdjust;startRY = TopAdjust;}; ftlObj.y += (pY+startRY-ftlObj.y)/16; ftlObj.sP(ftlObj.x, ftlObj.y); ftlObj2.y += (pY+startLY-ftlObj2.y)/16; ftlObj2.sP(ftlObj2.x, ftlObj2.y); setTimeout("stayTopLeft()", 1); } ftlObj = ml("divAdRight"); //stayTopLeft(); ftlObj2 = m2("divAdLeft"); stayTopLeft(); } function ShowAdDiv() { var objAdDivRight = document.getElementById("divAdRight"); var objAdDivLeft = document.getElementById("divAdLeft"); if (document.body.clientWidth < 1000) { objAdDivRight.style.display = "none"; objAdDivLeft.style.display = "none"; } else { objAdDivRight.style.display = "block"; objAdDivLeft.style.display = "block"; FloatTopDiv(); } } </script> <script> document.write("<script type='text/javascript' language='javascript'>MainContentW = 1000;LeftBannerW = 125;RightBannerW = 125;LeftAdjust = 5;RightAdjust = 5;TopAdjust = 10;ShowAdDiv();window.onresize=ShowAdDiv;;<\/script>"); </script>
    You will need to replace your images and your ULR into codes above.

    Cheers,

    Leave a comment:


  • FrozrnGod
    replied
    Hey, Of course, here you go.
    Attached Files

    Leave a comment:


  • Glenn Vergara
    replied
    Can you send a screenshot of where exactly you want to put the image?

    Leave a comment:


  • How can i put a fixed div with an Image 'under' the forums part.

    Hey guys,
    So what I want to achieve is that I will have 2 graphics of Heroes standing on both side of the main page forums part.
    After some thinking this can not be achieved with just changing the background so I have the Image which is 1612x497 and I want it to appear at the vertical middle of the screen on the forum homepage.

    How can i do that? Thanks!

Related Topics

Collapse

Working...
X