473,738 Members | 7,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

slideshow question

Hi
New to javascript. I'm trying to understand how a script at a website I come
across works.
http://www.BRPPISAFETY.COM
Nearly got it but I have changed the variable called 'crossFadeDurat ion'
to large numbers and small numbers but it doesn't seem to do anything. Could
someone explain what effect changing this variable should bring about and
why don't I see any changes.
many thanks
David

Dec 22 '05 #1
11 2404
it attempts to use Microsoft's proprietary filters (CSS extension) in
MSIE.
Using document.all it detects Explorer, then sets up changing the
image with the filters and starts it, setting up the transformation
duration parameter to the value given. If no MSIE is detected it just
flips images, disregarding all the filters part. But it seems it's
broken.

The piece:

document.images .SlideShow.styl e.filter="blend Trans(duration= 2)";
document.images .SlideShow.styl e.filter="blend Trans(duration= crossFadeDurati on)";

The first line would just set it to 2 seconds, but immediately the
second line overrides the value with string "crossFadeDurat ion" (as
opposed to value of variable crossFadeDurati on).

I bet what the author meant was

document.images .SlideShow.styl e.filter="blend Trans(duration= "+crossFadeDura tion+")";

Dec 22 '05 #2

<bw****@gmail.c om> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
it attempts to use Microsoft's proprietary filters (CSS extension) in
MSIE.
Using document.all it detects Explorer, then sets up changing the
image with the filters and starts it, setting up the transformation
duration parameter to the value given. If no MSIE is detected it just
flips images, disregarding all the filters part. But it seems it's
broken.

The piece:

document.images .SlideShow.styl e.filter="blend Trans(duration= 2)";
document.images .SlideShow.styl e.filter="blend Trans(duration= crossFadeDurati o
n)";
The first line would just set it to 2 seconds, but immediately the
second line overrides the value with string "crossFadeDurat ion" (as
opposed to value of variable crossFadeDurati on).

I bet what the author meant was

document.images .SlideShow.styl e.filter="blend Trans(duration= "+crossFadeDura t
ion+")";

Thanks for that. I commented out the line that seems to make the the filter
equal to the string "crossFadeDurat ion" and put your line in. What happens
now is there is no fade between images, it just show one image for 3 seconds
and then suddenly (no fade transition) flips to the other image for 3
seconds and so on. I then put the script back to how the author had it and
commented out the line
document.images .SlideShow.styl e.filter="blend Trans(duration= 2)";
and to my surprise it still has a 2 second fade between one image melting
away and the other fading in! (Each image is on screen for 3 seconds)
Any idea why your answer which looks good doesn't solve the mystery.
Thanks for the help
David

Dec 22 '05 #3

David Graham wrote:
<bw****@gmail.c om> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
it attempts to use Microsoft's proprietary filters (CSS extension) in
MSIE.
Using document.all it detects Explorer, then sets up changing the
image with the filters and starts it, setting up the transformation
duration parameter to the value given. If no MSIE is detected it just
flips images, disregarding all the filters part. But it seems it's
broken.

The piece:

document.images .SlideShow.styl e.filter="blend Trans(duration= 2)";

document.images .SlideShow.styl e.filter="blend Trans(duration= crossFadeDurati o
n)";

The first line would just set it to 2 seconds, but immediately the
second line overrides the value with string "crossFadeDurat ion" (as
opposed to value of variable crossFadeDurati on).

I bet what the author meant was

document.images .SlideShow.styl e.filter="blend Trans(duration= "+crossFadeDura t
ion+")";

Thanks for that. I commented out the line that seems to make the the filter
equal to the string "crossFadeDurat ion" and put your line in. What happens
now is there is no fade between images, it just show one image for 3 seconds
and then suddenly (no fade transition) flips to the other image for 3
seconds and so on. I then put the script back to how the author had it and
commented out the line
document.images .SlideShow.styl e.filter="blend Trans(duration= 2)";
and to my surprise it still has a 2 second fade between one image melting
away and the other fading in! (Each image is on screen for 3 seconds)
Any idea why your answer which looks good doesn't solve the mystery.
Thanks for the help
David


Dec 22 '05 #4

David Graham wrote:
<bw****@gmail.c om> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
it attempts to use Microsoft's proprietary filters (CSS extension) in
MSIE.
Using document.all it detects Explorer, then sets up changing the
image with the filters and starts it, setting up the transformation
duration parameter to the value given. If no MSIE is detected it just
flips images, disregarding all the filters part. But it seems it's
broken.

The piece:

document.images .SlideShow.styl e.filter="blend Trans(duration= 2)";

document.images .SlideShow.styl e.filter="blend Trans(duration= crossFadeDurati o
n)";

The first line would just set it to 2 seconds, but immediately the
second line overrides the value with string "crossFadeDurat ion" (as
opposed to value of variable crossFadeDurati on).

I bet what the author meant was

document.images .SlideShow.styl e.filter="blend Trans(duration= "+crossFadeDura t
ion+")";

Thanks for that. I commented out the line that seems to make the the filter
equal to the string "crossFadeDurat ion" and put your line in. What happens
now is there is no fade between images, it just show one image for 3 seconds
and then suddenly (no fade transition) flips to the other image for 3
seconds and so on. I then put the script back to how the author had it and
commented out the line
document.images .SlideShow.styl e.filter="blend Trans(duration= 2)";
and to my surprise it still has a 2 second fade between one image melting
away and the other fading in! (Each image is on screen for 3 seconds)
Any idea why your answer which looks good doesn't solve the mystery.
Thanks for the help


Sorry about the previous post that got away without any text!

You might be interested in looking at the XML language SMIL which is
designed for media presentations. This language has all sorts of
transitions, fades, etc built in. It requires a player on current
browsers, but it will work on all browsers that have the player
installed. The most recent Real players have nearly full support of W3C
SMIL2 built in, and these player are free to download from Real. There
are other players, some free and some not. Since many people do not
have a player capable of SMIL installed, SMIL often may not be the best
choice for a web page for the masses. However, in a network situation
where you have control of what is installed, it can be a very
attractive solution for media presentations. There is much information
about writing code in SMIL, with many examples, on the Real developer
site.

Dec 22 '05 #5
> it just show one image for 3 seconds and then suddenly (no fade transition) flips to the other image for
3 seconds and so on.
Actually, it starts the transition, but since
var crossFadeDurati on = 20;
(20 seconds) and slide changes in 3s, the pic changes -again- long
before the transition becomes somehow visible. crossFadeDurati on should
be less than 1000*slideShowS peed. Either increase one or lower the
other.
I then put the script back to how the author had it and commented out the line


and you deactivated the author's setting custom transition time of 2s
and instead let it fall back to MSIE built-in default of 2s. Same
happens in case of the original script, since text reading
"crossFadeDurat ion" is not a valid count of time in seconds, it falls
back to default of 2s.
Try changing in the original the "2" to "1" and see if it works faster.
It shouldn't. Then comment out the
"blendTrans(dur ation=crossFade Duration)"; line (leaving the "1" above)
and see if it speeds up. It should.

Dec 22 '05 #6

<bw****@gmail.c om> wrote in message
news:11******** *************@g 43g2000cwa.goog legroups.com...
it just show one image for 3 seconds and then suddenly (no fade transition) flips to the other image for 3 seconds and so on.
Actually, it starts the transition, but since
var crossFadeDurati on = 20;
(20 seconds) and slide changes in 3s, the pic changes -again- long
before the transition becomes somehow visible. crossFadeDurati on should
be less than 1000*slideShowS peed. Either increase one or lower the
other.
I then put the script back to how the author had it and commented out

the line
and you deactivated the author's setting custom transition time of 2s
and instead let it fall back to MSIE built-in default of 2s. Same
happens in case of the original script, since text reading
"crossFadeDurat ion" is not a valid count of time in seconds, it falls
back to default of 2s.
Try changing in the original the "2" to "1" and see if it works faster.
It shouldn't. Then comment out the
"blendTrans(dur ation=crossFade Duration)"; line (leaving the "1" above)
and see if it speeds up. It should.

Excellent help, it all works like you say.
Many thanks, this was a useful exercise for me.
David
Dec 22 '05 #7

<bw****@gmail.c om> wrote in message
news:11******** *************@g 43g2000cwa.goog legroups.com...
it just show one image for 3 seconds and then suddenly (no fade transition) flips to the other image for 3 seconds and so on.
Actually, it starts the transition, but since
var crossFadeDurati on = 20;
(20 seconds) and slide changes in 3s, the pic changes -again- long
before the transition becomes somehow visible. crossFadeDurati on should
be less than 1000*slideShowS peed. Either increase one or lower the
other.
I then put the script back to how the author had it and commented out

the line
and you deactivated the author's setting custom transition time of 2s
and instead let it fall back to MSIE built-in default of 2s. Same
happens in case of the original script, since text reading
"crossFadeDurat ion" is not a valid count of time in seconds, it falls
back to default of 2s.
Try changing in the original the "2" to "1" and see if it works faster.
It shouldn't. Then comment out the
"blendTrans(dur ation=crossFade Duration)"; line (leaving the "1" above)
and see if it speeds up. It should.

One thing I meant to ask was about this code being proprietary for IE. How
do other browsers manage to do a simple swap of the images as an alternative
to the fade transition when they don't know this code?
Dec 22 '05 #8
Noticed the if(document.all ) ?
Only MSIE uses document.all (all the others use
gocument.getEle mentById() ) and so anything contained within this 'if'
is executed only on Explorer. And it's only about transformation, it's
not about -what- gets transformed. The proper image swapping sits
outside the if() so it gets performed by all browsers:

document.images .SlideShow.src = preLoad[j].src;

If you read the HTML, you see:

<td><img SRC="br-01-1.jpg" NAME="SlideShow " height=163 width=250></td>

document.images .SlideShow is the Javascript/DOM object that corresponds
directly to this image tag. They just overwrite its src parameter with
one of predefined ones. If you did
alert(document. images.SlideSho w.width), you'd get 250. If you did
document.images .SlideShow.heig ht=300; the image would likely get
stretched vertically, about doubling in height. By doing
document.images .SlideShow.src= "http://www.google.com/logos/winter_holiday0 5_2res.gif";
you'll change the pic to current Google logo by simply changing the src
tag.

Dec 22 '05 #9

bw****@gmail.co m wrote:
Noticed the if(document.all ) ?
Only MSIE uses document.all (all the others use
gocument.getEle mentById() ) and so anything contained within this 'if'
is executed only on Explorer.


In fact Opera can use document.all so that it can execute some IE-type
code, but of course the Opera design team prefers getElementById, which
is the current official notation.

Also keep in mind that there are several browsers out there that are
actually only slightly modified IE6, but that have their own name. A
few are Avant, MyIE2, and SBC/Yahoo DSL. Some AOL browsers also are
based on IE6.

Dec 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
17111
by: Tim | last post by:
Hope someone in the big wide world can help... What I want to do is have an image slideshow which automatically scrolls through a series of images very fast, then pauses when you move your mouse over the image. The images will flick through (at a rate of about 5 per second) then pause when the user onMouseOver's. Any help would be gratefully received. :o)
2
3997
by: Susanna | last post by:
Hi all, I'm using the following slideshow script that I found on the web to display changing images with a crossfade effect. Eventually I will be adding many more images to the slideshow. The thing is, I ALSO have to make it so the images will load randomly. I have looked at a number of scripts for random-loading slideshows, but I have to find a way to COMBINE this fading-image script (or, a different fading-image script, if...
2
2101
by: Jeannie | last post by:
I have a popup window which is a slideshow of about 7 images. When the popup window loads, the first image is present and then the viewer can select next or previous to scroll through the rest of the images. I'd like to use the same popup window at different points throughout the website and have the Virtual Tour (slideshow) open up at the appropriate photos. Meaning I'd like to control which picture the popup window opens up to,...
8
2036
by: drillbit_99 | last post by:
I have an HTML page of thumbnail images. Each image can begin a slideshow of the images on the page by clicking on the image. This opens another HTML page that begins the slideshow using large images of the thumbnails. When the slideshow begins it always starts with the first image. I would like to pass the name of the thumbnail to the slideshow HTML page and begin the slideshow with the same image the user clicks on. Is this asking...
1
3347
by: ttamilvanan81 | last post by:
Hai everyone, I need to provide the slideshow for the images. I have upload the images into database. Then i will retrive all the images from the database and provide the slideshow for those images. I have try with the following jsp code. <%@ page language="java" %> <%@ page import="java.sql.*"%> <%@ page import="java.sql.Connection.*"%> <%@ page import="java.awt.image.*"%>
2
3142
pradeepjain
by: pradeepjain | last post by:
script> // (C) 2000 www.CodeLifter.com // http://www.codelifter.com // Free for all users, but leave in this header // NS4-6,IE4-6 // Fade effect only in IE; degrades gracefully // ======================================= // set the following variables // =======================================
3
1571
by: Gaby Sandoval | last post by:
I have a very simple javascript slideshow. It is extremely basic (see small sample below): <script language="JavaScript1.1"> <!-- //specify interval between slide (in mili seconds) var slidespeed=100
1
7485
by: maarten2002 | last post by:
Hi people, I am quite new to JS-scripting and I have a question. Finally I found a "good" slideshow which works in IE, Chrome, FF with prototype. The only thing is that I would like the slideshow to stop when the mouse is over the slideshow and start again when the pointer leaves the pics. Thanks alot in advance! Already found something, but don't know how to implement it:
0
8788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.