전단 - easyui 동적 전환 테마
                                            
 4344 단어  프로 그래 밍 언어전단
                    
 cookies  
 0) { 
		for(int i = 0; i < cookies.length; i++) { 
			if(cookies[i].getName().equals("easyuiThemeName")) { 
				themeName = cookies[i].getValue(); 
				break;
			}
		}
	}
%>
  css  
초기 불 러 오 는. js 파일 증가 방법
jQuery.cookie = function(key, value, options) {
	if (arguments.length > 1 && (value === null || typeof value !== "object")) {
		options = jQuery.extend({}, options);
		if (value === null) {
			options.expires = -1;
		}
		if (typeof options.expires === 'number') {
			var days = options.expires, t = options.expires = new Date();
			t.setDate(t.getDate() + days);
		}
		return (document.cookie = [
				encodeURIComponent(key),
				'=',
				options.raw ? String(value) : encodeURIComponent(String(value)),
				options.expires ? '; expires=' + options.expires.toUTCString(): '',
				options.path ? '; path=' + options.path : '',
				options.domain ? '; domain=' + options.domain : '',
				options.secure ? '; secure' : '' ].join(''));
	}
	options = value || {};
	var result, decode = options.raw ? function(s) {
		return s;
	} : decodeURIComponent;
	return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};
/**
 *     
 */
function changeThemeFun(themeName) {
    var $easyuiTheme = $('#easyuiTheme');
    var url = $easyuiTheme.attr('href');
    console.log(url);
    var href = url.substring(0, url.indexOf('themes')) + 'themes/' + themeName + '/easyui.css';
    $easyuiTheme.attr('href', href);
    var $iframe = $('iframe');
    if ($iframe.length > 0) {
        for ( var i = 0; i < $iframe.length; i++) {
            var ifr = $iframe[i];
            $(ifr).contents().find('#easyuiTheme').attr('href', href);
        }
    }
    $.cookie('easyuiThemeName', themeName, {
        expires : 7
    });
}
$(document).ready(function(){
	if ($.cookie('easyuiThemeName')) {
	    changeThemeFun($.cookie('easyuiThemeName'));
	}
});
테마 전환 방법: [실제 테마 에 따라 작성 하면 됩 니 다]
      [     ] : 
https://download.csdn.net/download/qq_17522211/10991959
ps: 기본 js 외 에 jquery. jdirk. js 도 참조 해 야 합 니 다.
jquery.jdirk.js    [     ]:
https://download.csdn.net/download/qq_17522211/10991963
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
셸 스 크 립 트 프로 그래 밍: sed 명령 으로 텍스트 편집red 는 온라인 편집기 의 일종 이다.그것 은 한 줄 의 내용 을 한꺼번에 처리한다.작업 중 에 한 고객 의 요 구 를 만 났 습 니 다. 기본 와 이 파이 의 ssid 이름 은 MAC 주소 의 뒷 6 자 리 를 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.