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 4 of 4
  1. #1
    suz
    suz is offline
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Beginner - How to change image size in slideshow

    I new at this so I'll try to be as accurate as possible.

    I am using a slideshow, but the images that I want to
    load are different sizes, and I want to set them individually,
    but don't know how. Any help?


    <script language="JavaScript1.1">
    <!--

    //Pixelating Image slideshow
    //Copyright Dynamic Drive 2001
    //Visit http://www.dynamicdrive.com for this script

    //specify interval between slide (in mili seconds)
    var slidespeed=3000
    //specify images
    var slideimages=new Array("photo-1.jpg","photo-2.jpg","photo-3.jpg","photo-4.jpg")
    //specify corresponding links
    var slidelinks=new Array("http://www.dynamicdrive.com","http://wsabstract.com","http://www.geocities.com")

    var imageholder=new Array()
    var ie55=window.createPopup
    for (i=0;i<slideimages.length;i++){
    imageholder[i]=new Image()
    imageholder[i].src=slideimages[i]
    }

    function gotoshow(){
    window.location=slidelinks[whichlink]
    }

    //-->
    </script>


    <a href="javascript:gotoshow()"><img src="photo1.jpg" name="slide" border=0 style="filterrogidXImageTransform.Microsoft.Pixelate(MaxSquare=15,Duration=1)"></a>

    <script language="JavaScript1.1">
    <!--
    var whichlink=0
    var whichimage=0
    var pixeldelay=(ie55)? document.images.slide.filters[0].duration*1000 : 0
    function slideit(){
    if (!document.images) return
    if (ie55) document.images.slide.filters[0].apply()
    document.images.slide.src=imageholder[whichimage].src
    if (ie55) document.images.slide.filters[0].play()
    whichlink=whichimage
    whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
    setTimeout("slideit()",slidespeed+pixeldelay)
    }
    slideit()

    //-->
    </script>


    Thanks,
    Suz.

  • #2
    New Coder
    Join Date
    Jul 2002
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try including the WIDTH and HEIGHT attributes in your style statement

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have a play with the following, this will keep all your images to a size of 100 x 100 just change size to suit.

    <HTML>
    <HEAD>
    <TITLE>Document Title</TITLE>
    </HEAD>
    <BODY>
    <DIV id=divA onfilterchange="" style="position:absolute; left:200; top:50px; width:100; height:100; font-size:35; text-align:center; filter(); border:5 inset blue;cursor:hand" onclick="Pre_Run()">Click Me</DIV>

    <SCRIPT language="javascript">
    <!--
    // see more at www.huntingground.net
    newTrans=new Array()
    newTrans[newTrans.length] = "progidXImageTransform.Microsoft.Pixelate(maxsquare=10)";

    pic=new Array()
    pic[pic.length]="photo-1.jpg"
    pic[pic.length]="photo-2.jpg"
    pic[pic.length]="photo-3.jpg"
    pic[pic.length]="photo-4.jpg"

    var preloadpics=new Array() // preloads images
    for (i=0;i<=pic.length-1;i++) {
    preloadpics[i]=new Image()
    preloadpics[i].src=pic[i]
    }

    var tranSpeed = 2.0; // how long transition takes in seconds
    var pause = 1000 // in milliseconds
    var advance = (tranSpeed*1000)+pause //
    var Running = 0;
    var i=0
    var picnum=0

    function Pre_Run(){
    Running = 0;
    RunMe();
    }

    function RunMe(){
    if (Running == 0){
    Running = 1;
    divA.style.filter = newTrans[i];
    divA.filters[0].apply();
    divA.innerHTML = "<img src='"+pic[picnum]+"'width='"+document.all.divA.style.width+"'height='"+document.all.divA.style.height+"'>"

    if(i==newTrans.length -1){
    i=-1}

    if(picnum==pic.length-1){
    picnum=-1}

    divA.filters[0].play(tranSpeed);
    i++
    picnum++
    }
    setTimeout("Pre_Run()",advance)
    }
    // -->
    </SCRIPT>
    </BODY></HTML>

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I notice that this forums smiley's interfere with the coding

    Where the green smiley is there should

    :ID

    The line should read

    newTrans[newTrans.length] = "progid:DXImageTransform.Microsoft.Pixelate(maxsquare=10)";


  •  

    Posting Permissions

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