繁体   English   中英

如何在Sencha Touch中交换CSS

[英]How to swap CSS in Sencha Touch

我需要交换在Sencha Touch中完成的Mobile应用程序的CSS。

目前,我未获得任何结果。 你能告诉我怎么做吗?

谢谢

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

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

                    }

                }

            };

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM