Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2003
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question I need to center image script

    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

    miss blue

  • #2
    New to the CF scene
    Join Date
    Mar 2003
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ???

    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.

  • #3
    New to the CF scene
    Join Date
    Feb 2003
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    here's some code...

    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>
    miss blue

  • #4
    New to the CF scene
    Join Date
    Mar 2003
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    New to the CF scene
    Join Date
    Feb 2003
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hi

    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

    miss blue

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    mis...
    try just a going®...
    <TD WIDTH=100% HEIGHT=416 border=0 bordercolor=Black align="center">


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •