如何为整个项目设置颜色 [英] How to set color to whole project
问题描述
你好我在运行时使用java脚本来改变颜色,但问题是,当改变颜色时,它只在我改变颜色的一页上设置颜色,如何在所有页面中设置该颜色..?
我使用此代码更改颜色
=========
< br $>
//主题切换器
var scrollHeight ='60px';
jQuery('#theme-change' ).click(function(){
if($(this).attr(open)&&!$(this).attr(opening)&&!$(this).attr (结束)){
$(this).removeAttr(open);
$(this).attr(closing,1) ;
$(#theme-change)。css(溢出,隐藏).animate({
宽度:'20px',
身高:'22px',
'padding-top':'3px'
},{
complete:function(){
$(this).removeAttr(closing);
$(#theme-change .settings) .hide();
}
});
}否则if(!$(this ).attr(closing)&&!$(this).attr(opening)){
$(this).attr(opening,1);
$(#theme-change)。css(溢出,可见)。动画({
宽度:'226px',
身高:scrollHeight,
'padding-top':'3px'
},{
complete:function(){
$(this).removeAttr(opening);
$(this).attr(open,1);
}
});
$(#theme-change .settings)。show();
}
});
jQuery('#theme-change .colors span')。click(function(){
var color = $ (这).attr(数据风格);
setColor(颜色);
});
jQuery('#theme-change .layout input')。change(function(){
setLayout();
});
var setColor = function(color){
$(' #style_color')。attr(href,css / style-+ color +。css);
}
< blockquote>(this).attr(open)&&!
(this).attr(opening)&&!
(这个).attr(关闭)){
hello i am use java script to change color at run time , But Problem is that when change color it set color at only one page from where i change color , How to set that color in all page ..?
I am using this code to change color
=========
// theme switcher
var scrollHeight = '60px';
jQuery('#theme-change').click(function () {
if ($(this).attr("opened") && !$(this).attr("opening") && !$(this).attr("closing")) {
$(this).removeAttr("opened");
$(this).attr("closing", "1");
$("#theme-change").css("overflow", "hidden").animate({
width: '20px',
height: '22px',
'padding-top': '3px'
}, {
complete: function () {
$(this).removeAttr("closing");
$("#theme-change .settings").hide();
}
});
} else if (!$(this).attr("closing") && !$(this).attr("opening")) {
$(this).attr("opening", "1");
$("#theme-change").css("overflow", "visible").animate({
width: '226px',
height: scrollHeight,
'padding-top': '3px'
}, {
complete: function () {
$(this).removeAttr("opening");
$(this).attr("opened", 1);
}
});
$("#theme-change .settings").show();
}
});
jQuery('#theme-change .colors span').click(function () {
var color = $(this).attr("data-style");
setColor(color);
});
jQuery('#theme-change .layout input').change(function () {
setLayout();
});
var setColor = function (color) {
$('#style_color').attr("href", "css/style-" + color + ".css");
}
(this).attr("opened") && !
(this).attr("opening") && !
(this).attr("closing")) {
这篇关于如何为整个项目设置颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!