Statically position Image

I'm trying to statically positon an image at the bottom of the pag

Page 1 of 1

1 Replies - 5325 Views - Last Post: 20 April 2008 - 07:34 PM

#1 mark2685  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-April 08

Statically position Image

Posted 20 April 2008 - 05:36 PM

I'm trying to position an image statically so that it is always viewable by the user, flush at the bottom of the screen. My problem is that it is off in different browsers / resolutions. Is there another way to do this that I'm not seeing?

My code is below.

Thanks for any help!

Also, Would there be a way to make this image appear behind any content? I tried changing the z-index, but it didn't work. Any other ideas?

CSS & Javascript
<div id="staticcontent" style="position:absolute; width: 1024px; height:129px; background:url(file:///C|/Documents and Settings/Administrator/My Documents/promoting_group/Pro Lab/html/images/misc/grass.gif) no-repeat;">
 
</div>

//define universal reference to "staticcontent"
var crossobj=document.all? document.all.staticcontent : document.getElementById("staticcontent")

//define reference to the body object in IE
var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body

function positionit(){
//define universal dsoc left point
var dsocleft=document.all? iebody.scrollLeft : pageXOffset
//define universal dsoc top point
var dsoctop=document.all? iebody.scrollTop : pageYOffset

//if the user is using IE 4+ or Firefox/ NS6+
if (document.all||document.getElementById){
crossobj.style.top=dsoctop+550+"px"
}
}
setInterval("positionit()",100)


This post has been edited by mark2685: 20 April 2008 - 05:38 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Statically position Image

#2 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Statically position Image

Posted 20 April 2008 - 07:34 PM

Why not just use CSS, and set position:fixed? Hereis some information on the CSS position property.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1