Пример #1
0
        // run the currently selected effect
        static void runEffect()
        {
            // get effect type from
            var selectedEffect = new jQuery("#effectTypes").val().As <EffectType>();
            // most effect types need no options passed by default
            var options = new JsObject {
            };

            if (selectedEffect.ExactEquals("scale"))
            {
                options = new { percent = 0 }.As <JsObject>();
            }
            else if (selectedEffect.ExactEquals("size"))
            {
                options = new { to = new { width = 200, height = 60 } }.As <JsObject>();
            }
            // run the effect
            new jQuery("#effect").hide(selectedEffect, options, 1000, callback);
        }
Пример #2
0
        // run the currently selected effect
        static void runEffect()
        {
            // get effect type from
            var selectedEffect = new jQuery("#effectTypes").val().As <EffectType>();
            var options        = new JsObject {
            };

            if (selectedEffect.ExactEquals("scale"))
            {
                options = new { percent = 0 }.As <JsObject>();
            }
            else if (selectedEffect.ExactEquals("transfer"))
            {
                options = new { to = "#button", className = "ui-effects-transfer" }.As <JsObject>();
            }
            else if (selectedEffect.ExactEquals("size"))
            {
                options = new { to = new Size {
                                    width = 200, height = 60
                                } }.As <JsObject>();
            }
            // run the effect
            new jQuery("#effect").effect(selectedEffect, options, 500, callback);
        }