?
Solved

javascript for google chrome

Posted on 2011-10-11
4
Medium Priority
?
429 Views
Last Modified: 2012-08-14
Hey guys how can i write javascript code so it can work in google?

 "progid:DXImageTransform.Microsoft.RandomDissolve()";
"progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=20, Duration=2, Enabled=false)";
"progid:DXImageTransform.Microsoft.RadialWipe(wipeStyle='clock')";
"progid:DXImageTransform.Microsoft.Wheel(spokes=4)";
"progid:DXImageTransform.Microsoft.Stretch(stretchStyle='spin')";
"progid:DXImageTransform.Microsoft.Stretch(stretchStyle='push')";

 var photo = document.getElementById(imgID);
 photo.filters[0].apply();                    
photo.filters[0].play();                      
photo.src = img.src;  


i am making a slide show but this thing only work in IE
0
Comment
Question by:JCWEBHOST
  • 3
4 Comments
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 1000 total points
ID: 36948439
what is it doing?
If you can explain the output you are seeing, it will save the analysis effort
0
 

Author Comment

by:JCWEBHOST
ID: 36948478
it is a banner image slide show
0
 

Author Comment

by:JCWEBHOST
ID: 36948486
//GET THE TRANSACTION

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)";
        }
    }

function ReceiveServerData(rValue)
        {
            //Receive server's response of a string rValue, which is prepared in the server's function
            //GetCallbackResult()
            var wds = rValue.split(";");
            //Assign the transition effect
            document.getElementById("ctl00_photo").style.filter = wds[1];
            //Preload the image file from server.  When finishing download, imageLoaded function will be called
            //with the img object as the argument                          
            var img  = new Image();
            img.onload = function(){ imageLoaded(this); }
            img.onerror = function(){ imageError(this); }
            img.onabort = function(){ imageError(this); }
            img.src = wds[0];                                            
        }
       
        function imageError(img)
        {
            //If image download errors occur, this function will be called.
            window.setTimeout("getNextImage()", 1000);
        }
       
       function imageLoaded(img)
        {
            var imgID = '<%= photo.ClientID %>';
            var photo = document.getElementById(imgID); //Find the image control object  
            photo.filters[0].apply();                       //Apply the transition effect
            photo.filters[0].play();                        //Play the effect and display the new image
            photo.src = img.src;                           //Assign the image to the image control
           
            window.setTimeout("getNextImage()", c_interval);//Initiate the next request
        }
0
 

Author Closing Comment

by:JCWEBHOST
ID: 36954763
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Integration Management Part 2
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

807 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