Click to See Complete Forum and Search --> : how do i center my images????


missblue
02-25-2003, 04:59 PM
Hi,

I'm hoping someone can help me with this.
I've got a 'lamellar' image script on my web page (about 5 images blend into each other one by one) on Macs it is centered in the middle of the browser (IE5) but when i view it on PCs its on the far left hand side (IE5&6)

Does anyone know a good bit of coding to help me center it ....

Hope you can help...thanks

pyro
02-25-2003, 05:05 PM
Note sure exactly what you are trying to do. Depending on what it is, one of these might be what you need. If not, post your code.

<center></center>
<div align="center"></div>

missblue
02-25-2003, 09:24 PM
hi,

got them centered in a table already in the body of the html

got this bit of script in the head

var picture = new Array()
picture[0]="images/sample1.jpg"
picture[1]="images/sample2.jpg"
picture[2]="images/sample3.jpg"
picture[3]="images/sample11.jpg"
picture[4]="images/sample7.jpg"
var pictureurl = new Array()
pictureurl[0]="#"
pictureurl[1]="#"
pictureurl[2]="#"
pictureurl[3]="#"
pictureurl[4]="#"
var target_url="_self"
var horizontal_pos=0
var vertical_pos=150
var x_slices=40
var pause=2



also have a seperate document called lamellar.js.....


Sorry its very long!!

var imgpreload=new Array()
for (i=0;i<=picture.length;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=picture[i]
}

var picturewidth
var pictureheight
var i_loop=0
var i_picture=0
var width_slice
var cliptop=0
var clipbottom
var i_clipright=1
var content=""
pause=pause*1000

function initiate() {
getcontent()
if (document.all) {
for (i=0;i<=x_slices;i++) {
var thisinners=eval("s"+i)
thisinners.innerHTML=content
var thiss=eval("document.all.s"+i+".style")
thiss.posLeft=horizontal_pos
thiss.posTop=vertical_pos
}
var thisspan = eval("document.all.s"+0)
picturewidth=thisspan.offsetWidth
pictureheight=thisspan.offsetHeight
width_slice=Math.ceil(picturewidth/x_slices)
clipbottom=pictureheight
document.all.whole.style.posLeft=horizontal_pos
document.all.whole.style.posTop=vertical_pos
i_picture++
openlamellar()
}
if (document.layers) {
for (i=0;i<=x_slices;i++) {
var thisinners=eval("document.s"+i+".document")
thisinners.write(content)
thisinners.close()
var thiss=eval("document.s"+i)
thiss.left=horizontal_pos
thiss.top=vertical_pos
}
var thisspan=eval("document.s"+0+".document")
picturewidth=thisspan.width
pictureheight=thisspan.height
width_slice=Math.ceil(picturewidth/x_slices)
clipbottom=pictureheight
document.whole.document.write(" ")
document.whole.document.close()
document.whole.left=horizontal_pos
document.whole.top=vertical_pos
i_picture++
openlamellarNN()
}
}

function openlamellar() {
clipleft=-width_slice
clipright=0
if (i_clipright<=width_slice) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.all.s"+i+".style")
thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright++
var timer=setTimeout("openlamellar()",20)
}
else {
clearTimeout(timer)
whole.innerHTML=content
var timer=setTimeout("changepicture()",pause)
}
}

function openlamellarNN() {
clipleft=-width_slice
clipright=0
if (i_clipright<=width_slice) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.s"+i)
thiss.clip.left=clipleft
thiss.clip.right=clipright
thiss.clip.top=cliptop
thiss.clip.bottom=clipbottom
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright++
var timer=setTimeout("openlamellarNN()",20)
}
else {
clearTimeout(timer)
document.whole.document.write(content)
document.whole.document.close()
var timer=setTimeout("changepictureNN()",2000)
}
}


function getcontent() {
content="<a href="+pictureurl[i_picture]+" target="+target_url+">"
content+="<img src="+picture[i_picture]+" border=0>"
content+="</a>"
}

function changepicture() {
i_clipright=0
clipleft=0
clipright=0
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.all.s"+i+".style")
thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
}
if (i_picture>picture.length-1) {i_picture=0}
getcontent()

for (i=0;i<=x_slices;i++) {
var thisinners=eval("s"+i)
thisinners.innerHTML=content
}
i_picture++
openlamellar()
}

function changepictureNN() {
i_clipright=0
clipleft=0
clipright=0
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.s"+i)
thiss.clip.left=clipleft
thiss.clip.right=clipright
thiss.clip.top=cliptop
thiss.clip.bottom=clipbottom
clipleft+=width_slice
clipright=clipleft+i_clipright
}
if (i_picture>picture.length-1) {i_picture=0}
getcontent()
for (i=0;i<=x_slices;i++) {
var thisinners=eval("document.s"+i+".document")
thisinners.write(content)
thisinners.close()
}
i_picture++
openlamellarNN()
}

document.write("<span id='whole' class='s'></span>")
for (i=0;i<=x_slices;i++) {
document.write("<span id='s"+i+"' class='s'></span>")
}
document.close()
window.onload=initiate

This works on mac and is centered ...any ideas??

Thanks




:)

pyro
02-25-2003, 09:50 PM
Try centering the <span>s

celebguy_dv
03-04-2003, 03:36 AM
http://banners.dollarmachine.com/pic/2014000/hal001.gif (http://www.kinkyceleb.com/1261795520)