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 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    expert java coders... can U C where the img size is?

    here is the code for kinda slide show, but some of my pics in the full size get squeezed down.... can you see where that is?
    Here is the html part:
    <script language="javascript" type="text/javascript" src="images/common.js"></script>

    </head>

    <body site="1">



    <!-- Holds thumbs and full together. -->
    <table border="0" rules=all cellpadding="0" cellspacing="0" width="100%">
    <tbody>
    <tr>
    <td colspan=2 valign="top"><center>
    <img src="images/4cav_rating.gif" width="130" height="21" valign="center" halign="center" border="0" alt="">
    <img src="images/4cav_rating.gif" width="130" height="21" valign="center" halign="center" border="0" alt="">
    </center><br>
    </td>
    </tr>

    <tr>
    <td class="NonPadded" valign="top" width="550">

    <table border="10" cellpadding="5" width="450" align=center id=full>
    <tbody>
    <tr>
    <td class="NonPadded" width="400">
    <br><br><br><br>
    <img src="images/ottawacavaliers.jpg" width="400" height="300"
    id="_ctl0_imgHouse" class="PhotoMain" name="show" onclick="openSlide();" alt="Ottawa Cavaliers">
    <br>
    <br>
    <br>
    <br>
    </td>
    </tr>

    <tr>
    <td colspan="2"></td>
    </tr>

    </tbody>
    </table>



    </td>

    <td id="THUMBNAILS" class="NonPadded" valign="top" width="0">

    <table id="_ctl0_eThumbnails_rptThumbnails" border="0" cellspacing="0" cols=2 align=center>
    <tbody>


    <!-- TEMPLATE FOR THUMBNAILS
    <tr>
    <td>
    <a href="images/full/" target="blank" title="">
    <img class="PhotoThumbnail" src="images/thumbs/" onmouseover="MM_swapImage('_ctl0_imgHouse','','images/full/',1)"></a><br>
    </td>

    <td>
    <a href="images/full/" target="blank" title="">
    <img class="PhotoThumbnail" src="images/thumbs/" onmouseover="MM_swapImage('_ctl0_imgHouse','','images/full/',1)"></a><br>
    </td>
    </tr>
    -->

    and here is the java bit:


    }
    }

    }


    }


    function MM_preloadImages() { //v3.0
    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_swapImgRestore() { //v3.0
    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_findObj(n, d) { //v4.01
    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() { //v3.0
    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];}
    }


    }
    }
    }

    }


    function getText(node){
    if(typeof node.innerText!="undefined"){
    return node.innerText;
    }
    return getNodeText(node);
    }
    function getNodeText(N){
    var s = '';
    for(var i=0, c=N.childNodes; i < c.length; ++i){
    if(c[i].nodeType==3) s+=c[i].nodeValue;
    else if(c[i].nodeType==1) s+=arguments.callee(c[i]);
    }
    return s

    }
    function openSlide(){
    var Height = 900;
    var Width = 500;
    var Top = (screen.height / 2) - (Height / 2);
    var Left = (screen.width / 2) - (Width / 2);
    var params = 'resizable=yes,scrollbars=yes,height=' + Height + ',width=' + Width + ',top=' + Top + ',left=' + Left;




    }


    ---------------------
    I bet the var top and left have something to do with it..... but I am not sure.

    Any ideas?

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,511
    Thanks
    3
    Thanked 504 Times in 491 Posts
    the image size is specified in the main image tags

    change the src will not change this specified size.

    not recommended but simplest to remove the width and height attributes
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    Regular Coder
    Join Date
    Oct 2006
    Location
    Bristol
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just like to point out....Java is NOT the same as Javascript

    Alex
    Give me Rep if I was helpful and ignore if I wasn't ;)

    http://www.google.com <--use this before asking

    Nominate a Helpful Member


  • #4
    New Coder
    Join Date
    Feb 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have put the height and width in the image tag, but when it shows up on the screen, it is stretched or squished.

    Me thinks it's in the first bit of the java part......
    unction MM_preloadImages() { //v3.0
    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];}}


    What do you think?

  • #5
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,511
    Thanks
    3
    Thanked 504 Times in 491 Posts
    simplest to remove the width and height attributes
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Posting Permissions

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