Solved

Javascript "fade-in" effect for picture slideshow?

Posted on 2010-09-23
6
1,122 Views
Last Modified: 2013-11-19
I have a JavaScript function that is used to create a simple slideshow on my webpage. In IE, it has a nice fade in effect between slides. How can I make the effect work for other browsers like Firefox/Safari/Chrome/etc ?
0
Comment
Question by:rwskas
6 Comments
 
LVL 13

Accepted Solution

by:
darren-w- earned 250 total points
ID: 33743161
Hi,

If you use the jquery fadein() function it will be compatible with most browsers, but if you did decide to reconfigure your code you would need to re-factor it to work with each browser, you will need to supply the code so we could take a look

http://api.jquery.com/fadeIn/

Darren

0
 
LVL 22

Expert Comment

by:kadaba
ID: 33743304
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33743513
<< I have a JavaScript function that is used to create a simple slideshow on my webpage>>
Can you share that method, so that we can suggest the changes?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Author Comment

by:rwskas
ID: 33744672
Sorry, I posted in haste this morning and forgot to put the function! Here is what I am using: (Disclaimer: I am a beginer, and this is cobbled together from things I found via google)

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 250 total points
ID: 33744845
<<document.images.SlideShow.style.filter>>
Assuming that SlideShow is the value of name attribute of the img tag, i don't think it works on all browsers.
Also you are checking for the document.all, which is not supported on all browsers.

would encourage you to use document.getElementById()

Similarly, filter is also not supported on all browser, infact to my knowledge, it is only supported on IE

I would encourage you to use jquery only (like fellow experts), since it takes care of all these problems and give you an same interface to make things work the same way on all browsers.




0
 
LVL 6

Author Closing Comment

by:rwskas
ID: 33788014
Going to use the JQuery technique, thanks for the pointing me in the right direction.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now