Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > should be easy but!!!

should be easy but!!!
Thread Tools
qnc
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status: Offline
Reply With Quote
Nov 27, 2002, 11:48 AM
 
I have a slide show working @

http://qnctv.com/preacher/slide.htm

but I want to be able to get the correct sizes for the pictures.

I have attempted an "if else" condition but it doesn't work.

if thisPic = ("http://qnctv.com/preacher/sofa.jpg","http://qnctv.com/preacher/cow.jpg","http://qnctv.com/preacher/hill.jpg","http://qnctv.com/preacher/luge.jpg","http://qnctv.com/preacher/train.jpg") {document.myPicture.src(height="300" width="400")=myPix[thisPic]}
else {document.myPicture.src(height=400 width=300)=myPix[thisPic]}
document.myPicture.src=myPix[thisPic]

there is also a specification in the body width height etc... but the idea would be to define for the pictures.


Can you have a look it is very tiny. it is in Javascript

full source @

http://qnctv.com/preacher/slidesize.htm

can anyone help




Report this post to a moderator | IP: Logged
(Last edited by qnc; Nov 27, 2002 at 11:54 AM. )
qnctv.com
Take a look...
     
Forum Regular
Join Date: Jun 2002
Location: New York
Status: Offline
Reply With Quote
Nov 27, 2002, 04:53 PM
 
In the img tag, remove the width and height attributes (line 46). JavaScript can't change those so the pictures are scaled to fit those dimensions.

The width and height attributes are really only necessary if you're showing an image at something other than its original size (showing a 300 by 200 image as 150 by 100...).

I removed the attributes and tested it locally. It works like a charm.

-Peter

(Whoops, the bulletin board didn't like my less-than and greater-than signs...)
     
qnc  (op)
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status: Offline
Reply With Quote
Nov 28, 2002, 04:30 AM
 
<script>
<!-- Hide script from old browsers

myPix = new Array("http://qnctv.com/preacher/sofa.jpg","http://qnctv.com/preacher/beach.jpg","http://qnctv.com/preacher/betty.jpg","http://qnctv.com/preacher/boron.jpg","http://qnctv.com/preacher/cow.jpg","http://qnctv.com/preacher/daisy.jpg","http://qnctv.com/preacher/darkness.jpg","http://qnctv.com/preacher/elmo.jpg","http://qnctv.com/preacher/gurn.jpg","http://qnctv.com/preacher/hill.jpg","http://qnctv.com/preacher/ince.jpg","http://qnctv.com/preacher/llama.jpg","http://qnctv.com/preacher/luge.jpg","http://qnctv.com/preacher/noddy.jpg","http://qnctv.com/preacher/ronin.jpg","http://qnctv.com/preacher/train.jpg")
thisPic = 0
imgCt = myPix.length - 1

function chgSlide(direction) {
if (document.images) {
thisPic = thisPic + direction
if (thisPic > imgCt) {
thisPic = 0
}
if (thisPic < 0) {
thisPic = imgCt
}
if thisPic = ("http://qnctv.com/preacher/sofa.jpg","http://qnctv.com/preacher/cow.jpg","http://qnctv.com/preacher/hill.jpg","http://qnctv.com/preacher/luge.jpg","http://qnctv.com/preacher/train.jpg") {document.myPicture.src(height="300" width="400")=myPix[thisPic]}
else {document.myPicture.src(height="400" width="300")=myPix[thisPic]}
document.myPicture.src=myPix[thisPic]
}
}

// End hiding script from old browsers -->
</SCRIPT>


<IMG SRC="http://qnctv.com/preacher/sofa.jpg" NAME="myPicture" ALT="Slideshow"></P>
<H1 ALIGN="CENTER"><A HREF="javascript:chgSlide(-1)">&lt;&lt; Previous</A>&nbsp;&nbsp;<A HREF="javascript:chgSlide(1)">Next &gt;&gt;</A></H1>


</body>


still not working

so frustarting when you are so close


Quincy
qnctv.com
Take a look...
     
qnc  (op)
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status: Offline
Reply With Quote
Nov 28, 2002, 04:36 AM
 
Copied the code here and it gave the slide show strange!!

anyway the pictures dont change

full code -body H and W

http://qnctv.com/preacher/slidesize1.htm

Thanks for all the help Quincy
qnctv.com
Take a look...
     
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
Dec 9, 2002, 10:45 AM
 
http://frileystangeg4.student.iastate.edu/slides.html

Works just fine for me in Internet Explorer 5.2.2, Chimera nightly build, and Netscape 7. I didn't write the checking for if it is in the array but it seems you know how to do it already. Problems, lemme know.

Travis
forté web design
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:24 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2