Solved

Javascript "fade-in" effect for picture slideshow?

Posted on 2010-09-23
6
1,129 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

726 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