?
Solved

Javascript "fade-in" effect for picture slideshow?

Posted on 2010-09-23
6
Medium Priority
?
1,132 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 1000 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:Gurvinder Pal Singh
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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:Gurvinder Pal Singh
Gurvinder Pal Singh earned 1000 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

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

777 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