Results 1 to 4 of 4

Thread: Image Thumbnail Viewer II

  1. #1
    Join Date
    Dec 2005
    Location
    UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Image Thumbnail Viewer II

    I've just finished adding the script to my site and can't figure out why the images aren't showing on the page. This the code I used:

    In the head;-

    <script type="text/javascript">

    //Specify image paths and optional link (set link to "" for no link):
    var dynimages=new Array()
    dynimages[0]=["sample1.png", ""]
    dynimages[1]=["sample2.png", ""]
    dynimages[2]=["sample3.png", ""]
    dynimages[3]=["sample4.png", ""]
    dynimages[4]=["sample5.png", ""]
    dynimages[5]=["sample6.png", ""]

    //Preload images ("yes" or "no"):
    var preloadimg="yes"

    //Set optional link target to be added to all images with a link:
    var optlinktarget=""

    //Set image border width
    var imgborderwidth=0

    //Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
    var filterstring="progidXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"

    ///////No need to edit beyond here/////

    if (preloadimg=="yes"){
    for (x=0; x<dynimages.length; x++){
    var myimage=new Image()
    myimage.src=dynimages[x][0]
    }
    }

    function returnimgcode(theimg){
    var imghtml=""
    if (theimg[1]!="")
    imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
    imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
    if (theimg[1]!="")
    imghtml+='</a>'
    return imghtml
    }

    function modifyimage(loadarea, imgindex){
    if (document.getElementById){
    var imgobj=document.getElementById(loadarea)
    if (imgobj.filters && window.createPopup){
    imgobj.style.filter=filterstring
    imgobj.filters[0].Apply()
    }
    imgobj.innerHTML=returnimgcode(dynimages[imgindex])
    if (imgobj.filters && window.createPopup)
    imgobj.filters[0].Play()
    return false
    }
    }

    </script>

    In the body;-

    <CENTER><a href="sample1.png" onMouseover="modifyimage('dynloadarea', 0)"><IMG SRC="sample1.png"></a>
    <a href="sample2.png" onMouseover="modifyimage('dynloadarea', 1)"><IMG SRC="sample2.png"></a>
    <a href="sample3.png" onMouseover="modifyimage('dynloadarea', 2)"><IMG SRC="sample3.png"></a>
    <a href="sample4.png" onMouseover="modifyimage('dynloadarea', 3)"><IMG SRC="sample4.png"></a>
    <a href="sample5.png" onMouseover="modifyimage('dynloadarea', 4)"><IMG SRC="sample5.png"></a>
    <a href="sample6.png" onMouseover="modifyimage('dynloadarea', 5)"><IMG SRC="sample6.png"></a>
    <br>
    <div id="dynloadarea" style="width:80px;height:225px"></div></CENTER>

    The images are in the root directory with the page, but aren't showing up... Anyone had a similar problem (or noticed a mistake I've missed)?

    Oh, by the way, the "big grin" image shouldn't be there, it's actually the : and D that are right next to each other!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If that's your site, linked at the bottom of your post, your upload was bad or the file was bad to begin with, I'm getting:

    The image “http://wearewatching.5000megs.com/sample1.png” cannot be displayed, because it contains errors.
    In FF.

    If that's not your site, I need your site's URL and preferably a link to the problem page to figure it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2005
    Location
    UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Host of problems...

    I've just been notified that the problems caused by my host, apparently PNG's (the type of images I used for the script) take up too much bandwidth so they get blocked by the 'on board software'! Ironically they do allow BMP's, hmm.....

    Thanks anyway jscheuer1 for trying to help.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, for graphics, a .gif is similar and for pictures, .jpg is good. I think the .png ban is stupid. A more intelligent way for the host to deal with this would be simply to limit file size. Any graphic in any format can take up too much space and/or bandwidth.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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