I've made a simple script to change the color of a div with the class '.logged_inn_text'. The script works by taking the background style from the clicked link and inserting it to the class.
The code was made in Chrome and it worked perfectly fine, while in IE and Edge nothing happens. If I alert the var named color, there is no response. Is there a reasonable reason why it's not working?
$(document).ready(function() {
$('.settings_color_btn').click(function() {
var colorId = $(this).attr('id');
var colorIdFull = '#'+colorId;
var color = $(colorIdFull).css('background');
$('.logged_inn_text').fadeTo('fast', 0.4, function() {
$(this).css('background', color);
}).fadeTo('fast', 1);
return false;
});
});
this? Anyway, assuming you're using a version of jQuery that works in the browsers you're using, there's no reason jQuery wouldn't work in IE.var color = $(colorIdFull).css('background');will not give you a color,var color = $(colorIdFull).css('backgroundColor');shouldrgb(255, 0, 0) none repeat scroll 0% 0% ....etc. and setting that value as thebackgroundstyle on another element should be valid as well.