...

View Full Version : I need to center image script



missblue
03-04-2003, 12:40 AM
Hi,

I'm trying to center an image script in my web page...on macs its centered but on pcs its over on the lefthand side of the screen. Here's an excerpt of the code ..can anyone help me...i just want it to be in the center : ( Tried it in a table and within <DIV></DIV> and <CENTER></CENTER> but nothing works...help!!

Thanks

miss blue


<---------------------------------------------the code----------------------------------------------------------->

this is in the head....


<HEAD>
<style>
.s {
position:absolute;
left:-5000px;
top:-5000px;
}
</style>
</HEAD>

this is in the body........

<BODY>

// target of the picture-links (HTML conventions)
var target_url="_blank"

// horizontal position of the slideshow (distance to the left margin of the window)
var horizontal_pos=10

// vertical position of the slideshow (distance to the top margin of the window)
var vertical_pos=150

// number of lamellas.
var x_slices=10

// pause beween the pictures (seconds)
var pause=2

</BODY>

thanks

:)

sigurs
03-04-2003, 06:34 AM
Where is your image pasted?

Is the image using the "s" class?

How did you center your image in a table?

Paste some code, please. Maybe I can help you.

missblue
03-04-2003, 11:35 PM
Hi Sigurs,

Here's the code..let me know what you think

: )


<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 4.01
Transitional//EN">
<HTML>
<HEAD>
<TITLE>The Code</TITLE>
<style type=text/css>
<!--
a:visited {
color: #cccccc;
text-decoration: none;
}
a:hover {
color: #000000;
}
a:link {
color: #999999;
text-decoration: none;
}

//a:active { color: #999999}
-->
</style><style>
.s {
position:absolute;
left:-5000px;
topt:-5000px;
}
</style><script language=JavaScript type=text/JavaScript>
<!--
function MM_swapImgRestore(){
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages(){
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
if(a[i].indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d){
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for(i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage(){
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script></HEAD><BODY BGCOLOR=White TEXT=Black
onLoad="MM_preloadImages('images/sred.gif','images/swhite.gif')">

<TABLE WIDTH=100% HEIGHT=98% BORDER=0 align=center CELLPADDING=0
CELLSPACING=0><TR>
<TD WIDTH=100% HEIGHT=416 border=0 bordercolor=Black>
<center><p align=center> <script>
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/sample12.jpg"
picture[5]="images/sample6.jpg"

var pictureurl = new Array()
pictureurl[0]="#"
pictureurl[1]="#"
pictureurl[2]="#"
pictureurl[3]="#"
pictureurl[4]="#"
pictureurl[5]="#"
pictureurl[6]="#"

var target_url="_self"

var horizontal_pos=0

var vertical_pos=150

var x_slices=40

var pause=2
// - End of JavaScript - -->
</script> <script src=lamellas.js></script>
</p></center></TD></TR><TR> <TD
HEIGHT=56 align=center valign=middle>

<OBJECT
CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
WIDTH="3"HEIGHT="3"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">

<PARAM name="SRC" VALUE="didili.mov">
<PARAM name="AUTOPLAY" VALUE="true">
<PARAM name="CONTROLLER" VALUE="false">
<EMBED SRC="sounds/didili.mov" WIDTH="3"
HEIGHT="3" AUTOPLAY="true"
CONTROLLER="false" PLUGINSPAGE="http://www.apple.com/quicktime/download/">

</EMBED>
</OBJECT></p>
<table width=100% height=47 border=0 cellpadding=0
cellspacing=0><TR align=center valign=bottom>
<td width=9%><div align=left>
<a href=../indexpeople.html
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('Image1','','images/sred.gif',1)">

<img src=images/swhite.gif name=Image1 width=56 height=46
border=0></a></div></td> <td width=81%
valign=middle>
<div align=center><font color=999999 size=4
face="Verdana,Arial,Helvetica,sans-serif">
<a
href=../indexpeople.html>back</a></font></div></td>
<td width=10%><div align=right>
<a href=documents/j.html
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('Image2','','images/swhite.gif',1)">

<img src=images/sred.gif name=Image2 width=56 height=46
border=0></a></div></td></TR></TABLE>

</TD></TR>
</TABLE>
</body>
</html>

sigurs
03-07-2003, 06:04 AM
Hi,

I tried it on my computer, and the QuickTime movie appears centered (I closed the <td> and <tr> tags after <object>...</object>).

I also checked this part of your script out (but it doesn't display anything):

<TABLE WIDTH=100% HEIGHT=98% BORDER=0 align=center CELLPADDING=0
CELLSPACING=0><TR>
<TD WIDTH=100% HEIGHT=416 border=0 bordercolor=Black>
<center><p align=center> <script>
var picture = new Array()
picture[0]="images/powrot1.gif"
picture[1]="images/powrot2.gif"
picture[2]="images/powrot1.gif"
picture[3]="images/powrot2.gif"
picture[4]="images/powrot1.gif"
picture[5]="images/powrot2.gif"
/*
picture[0]="images/sample1.jpg"
picture[1]="images/sample2.jpg"
picture[2]="images/sample3.jpg"
picture[3]="images/sample11.jpg"
picture[4]="images/sample12.jpg"
picture[5]="images/sample6.jpg"
*/

var pictureurl = new Array()
pictureurl[0]="#"
pictureurl[1]="#"
pictureurl[2]="#"
pictureurl[3]="#"
pictureurl[4]="#"
pictureurl[5]="#"
pictureurl[6]="#"

var target_url="_self"

var horizontal_pos=0

var vertical_pos=150

var x_slices=40

var pause=2
// - End of JavaScript - -->
</script> <script src=lamellas.js></script>
</p></center>
</TD></TR>

Did you want to center the above part of your script? I displayed one picture in this part and it appeared centered...

Let me know if you're still experiencing problems,

sigurs

missblue
03-10-2003, 03:47 PM
Hi Sigurs,

Thanks for the suggestion...I've put up the page at

http://www.misfit.org.uk

so you can see the problem I'm trying to fix. If you look at it on a pc the images are all on the left : (

Any ideas would be welcomed

thanks

:)

justame
03-10-2003, 04:56 PM
mis...
try just a going®...
<TD WIDTH=100% HEIGHT=416 border=0 bordercolor=Black align="center">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum