easyui换肤,

今天遇到了一个easyui换肤的问题,但是内部的控件(iframe)并没有跟着换肤。

解决办法:

js:

var themes1 = {
'gray' : '../../easyui/themes/gray/easyui.css',
'black' : '../../easyui/themes/black/easyui.css',
'bootstrap' : '../../easyui/themes/bootstrap/easyui.css',
'default' : '../../easyui/themes/default/easyui.css',
'metro' : '../../easyui/themes/metro/easyui.css'
};

 

var $iframe=$('iframe');
if ($iframe.length > 0) {
for ( var i = 0; i < $iframe.length; i++) {
var ifr = $iframe[i];
$(ifr).contents().find('#swicth-style').attr('href', themes1[skin]);
}
}

 

//注释

#swicth-style  为定义在引用css的上的id

 

posted @ 2013-08-06 09:23  小郑  阅读(1109)  评论(1编辑  收藏  举报