Solved

Javascript "fade-in" effect for picture slideshow?

Posted on 2010-09-23
6
1,127 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Understanding mobile browsers 9 64
Jquery GMAP3 Hierarchy 1 27
how i fix Remove render-blocking JavaScript 3 54
Save ms data to server side. 19 43
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

772 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