?
Solved

javascript

Posted on 2011-10-11
2
Medium Priority
?
278 Views
Last Modified: 2012-05-12
Hey guys i have a javascript that changes images in my website but the transactions affects do not work in google chrome.

can some please help apply some affects to my image while it changes?

here my java code (some of the code)

 function imageLoaded(img)
        {
            var browser=navigator.appName;

            if (browser=="Microsoft Internet Explorer")
              {
                var imgID = '<%= photo.ClientID %>';
                var photo = document.getElementById(imgID);
                photo.filters[0].apply();                    
                photo.filters[0].play();                      
                photo.src = img.src;                          
           
                window.setTimeout("getNextImage()", c_interval);
            }
            else
            {
                var imgID = '<%= photo.ClientID %>';
                var photo = document.getElementById(imgID);
                photo.src = img.src;                          
           
                window.setTimeout("getNextImage()", c_interval);
            }
        }


Here my c# code:

 private string GetNextTransition()
    {
        int n = (int)((new Random().NextDouble()) * 5);
        switch (n)
        {
            case 0:
            case 1:
                n = (int)((new Random().NextDouble()) * 22);
                return "revealTrans(duration=2,transition=" + n.ToString() + ")";
            case 2:
            case 3:
                if (Request.Browser.Browser == "IE")
                {
                    n = (int)((new Random().NextDouble()) * 8);
                    switch (n)
                    {
                        case 0:
                            return "progid:DXImageTransform.Microsoft.RandomDissolve()";
                        case 1:
                            return "progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=20, Duration=2, Enabled=false)";
                        case 2:
                            return "progid:DXImageTransform.Microsoft.RadialWipe(wipeStyle='clock')";
                        case 3:
                            return "progid:DXImageTransform.Microsoft.Wheel(spokes=4)";
                        case 4:
                            return "progid:DXImageTransform.Microsoft.Stretch(stretchStyle='spin')";
                        default:
                            return "progid:DXImageTransform.Microsoft.Stretch(stretchStyle='push')";
                    }
                }
                else
                    return "blendTrans(duration=2)";
            default:
                return "blendTrans(duration=2)";
        }
    }
0
Comment
Question by:JCWEBHOST
2 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 1000 total points
ID: 36949316
If you need cross-browser compatibility, obviously, you'll never get it by using Microsoft transition effects. I think the better approach might be to go with a jquery plug-in like this one:

http://workshop.rs/projects/jqfancytransitions/

...but that's just the first one that popped up in a Google search.
0
 

Author Closing Comment

by:JCWEBHOST
ID: 36954769
thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Integration Management Part 2
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

839 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