Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Align Image with bottom of browser?

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I'm trying to get an image to always stay on the bottom of the browser regardless of scrolling throught the page. Any suggestions?
 
Hi killerpoo!

It can easily be done with layers. Play with the code above. If you are not successful just say!

Code:
<title>æÉËÓÉÒÏ×ÁÎÎÁÑ ÓÓÙÌËÁ</title>

<style>
#divBottom{position:absolute; font-family:arial,helvetica; height:20; width:100; font-size:12pt; font-weight:bold} 
</style>
<script language=&quot;JavaScript1.2&quot;>
/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at [URL unfurl="true"]www.bratta.com[/URL]
Visit for more great scripts.
This may be used freely as long as this msg is intact!
********************************************************************************/

/********************************************************************************
Remeber to set the look of the divBottom layer in the stylesheet (if you wan't
another font or something)
********************************************************************************/

/*Set these values, gright for how much from the right you wan't the layer to go
and gbottom for how much from the bottom you wan't it*/

var gright=170
var gbottom=40

//Browsercheck
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;


/********************************************************************************
Constructing the ChangeText object
********************************************************************************/
function makeObj(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'
   	this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')							
	this.moveIt=b_moveIt;
}
function b_moveIt(x,y){
	this.x=x; this.y=y
   	this.css.left=this.x
	this.css.top=this.y
}
/********************************************************************************
Initilizing the page, getting height and width to moveto and calls the 
object constructor
********************************************************************************/
var pageWidth,pageHeight
function geoInit(){
	oTest=new makeObj('divBottom')
	pageWidth=(ie)?document.body.offsetWidth-4:innerWidth;
	pageHeight=(ie)?document.body.offsetHeight-2:innerHeight;
	checkIt()
	//sets the resize handler.
	onresize=resized
	if(ie) window.onscroll=checkIt;
}
/********************************************************************************
This function executes onscroll in ie and every 30 millisecond in ns
and checks if the user have scrolled, and if it has it moves the layer.
********************************************************************************/
function checkIt(){
	if(ie) oTest.moveIt(document.body.scrollLeft +pageWidth-gright,document.body.scrollTop+pageHeight-gbottom)
	else if(n){
		oTest.moveIt(window.pageXOffset+pageWidth-gright, window.pageYOffset+pageHeight-gbottom)
		setTimeout('checkIt()',20)
	}
}

//Adds a onresize event handler to handle the resizing of the window.
function resized(){
	pageWidth=(ie)?document.body.offsetWidth-4:innerWidth;
	pageHeight=(ie)?document.body.offsetHeight-2:innerHeight;
	if(ie) checkIt()
}


//Calls the geoInit onload
onload=geoInit;

//Here we will write the div out so that lower browser won't see it.
if(n || ie) document.write('<div id=&quot;divBottom&quot;><a href=&quot;#&quot;>[URL unfurl="true"]www.evrsoft.com</a></div>')[/URL]
</script>
</HEAD>

<BODY>
<center>
<!-- Russian LinkExchange code START 
  <iframe
  src=[URL unfurl="true"]http://www.linkexchange.ru/cgi-bin/erle.cgi?39185?Rnd_Num[/URL]
  frameborder=0 vspace=0 hspace=0 width=468 height=60
  marginwidth=0  marginheight=0 scrolling=no>
  <a href=[URL unfurl="true"]http://www.linkexchange.ru/users/039185/goto.map[/URL] target=_top>
  <img src=[URL unfurl="true"]http://www.linkexchange.ru/cgi-bin/rle.cgi?39185?Rnd_Num[/URL]
  alt=&quot;RLE Banner Network&quot; border=0 height=60 width=468></a>
  </iframe>
 Russian LinkExchange code END -->
</center>
Your content goes here!<br>
1<br><br><br><br><br><br><br><br><br><br>
2<br><br><br><br><br><br><br><br><br><br>
3<br><br><br><br><br><br><br><br><br><br>
4<br><br><br><br><br><br><br><br><br><br>
5<br><br><br><br><br><br><br><br><br><br>
Good Luck! :-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top