【问题标题】:How to swap CSS in Sencha Touch如何在 Sencha Touch 中交换 CSS
【发布时间】:2012-10-26 22:14:51
【问题描述】:

我需要为我在 Sencha Touch 中完成的移动应用程序交换 css。

目前我=我没有得到任何结果。 你能告诉我怎么做吗?

谢谢

【问题讨论】:

    标签: sencha-touch extjs sencha-touch-2 sencha-touch-theming


    【解决方案1】:

    我用这段代码解决了这个问题...

    var accessibilityButton = {
                    xtype: 'button',
                    ui: 'custom-btn-confirm',
                    maxWidth: '360px',
                    centered: true,
                    flex: 1,
                    scope: this,
                    style: 'color: #ffffff',
                    text: 'Active Accesibility',
                    ui: 'custom-btn-confirm',         
    
                    handler: function changeStyle() {
                        // Swap the CSS for Accessibility
                        var i, a, url, btn;
                        for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
                            if(a.getAttribute("rel").indexOf("style") != -1) {
                                url = a.href;
                                btn = document.getElementById("ext-element-114");
    
                                if(url.lastIndexOf('app.css') !== -1) {
                                    a.href = 'resources/css/app-accesibility.css';
                                    btn.textContent = "AAAA";
                                }
                                else {
                                    a.href = 'resources/css/app.css';
                                    btn.textContent = "BBBB";
                                }
                            } 
    
                        }
    
                    }
    
                };
    

    【讨论】:

      猜你喜欢
      • 2014-07-27
      • 1970-01-01
      • 1970-01-01
      • 2013-02-15
      • 1970-01-01
      • 2012-05-21
      • 2012-05-01
      • 1970-01-01
      • 2011-05-17
      相关资源
      最近更新 更多