...

View Full Version : Beginner - How to change image size in slideshow



suz
07-24-2002, 07:52 PM
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="filter:progid:DXImageTransform.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.

Mrs G
07-29-2002, 09:33 PM
Try including the WIDTH and HEIGHT attributes in your style statement

Mrs G
07-29-2002, 09:48 PM
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] = "progid:DXImageTransform.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>

Mrs G
07-29-2002, 09:53 PM
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)";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum