Click here to Skip to main content
16,015,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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");
}
Posted

1 solution

put all code in separate javascript file and add this javascript file to every page..
 
Share this answer
 
Comments
Member 10592827 13-Feb-14 2:53am    
Hello Amol Jadhao ,
i already do that as u told but still not Working as i want
Thank you for reply But i am not getting that i want

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900