Link to home
Start Free TrialLog in
Avatar of JCWEBHOST
JCWEBHOST

asked on

javascript for google chrome

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
ASKER CERTIFIED SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JCWEBHOST
JCWEBHOST

ASKER

it is a banner image slide show
//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
        }
thanks