我无法使用以下代码。知道为什么吗?
值正确。我可以使用alert(字段)测试它们,但背景渐变不起作用。我不明白为什么。
var myOptions = {
change: function(event, ui){
button_text_color = $('#button_text_color').val();
button_border_color = $('#button_border_color').val();
button_bg_color = $('#button_bg_color').val();
button_bg_color2 = $('#button_bg_color2').val();
div_preview = $('.ajax-live-preview-custom');
div_preview.find('.wp-superlike-button').css({
'color': button_text_color,
'borderColor' : button_border_color,
'backgroundColor': button_bg_color,
'backgroundImage': '-webkit-gradient(linear, 0% 0%, 0% 100%, from(' + button_bg_color + '), to(' + button_bg_color2 + '))',
'backgroundImage': '-webkit-linear-gradient(top, ' + button_bg_color + ', ' + button_bg_color2 + ')',
'backgroundImage': '-moz-linear-gradient(top, ' + button_bg_color + ', ' + button_bg_color2 + ')',
'backgroundImage': '-ms-linear-gradient(top, ' + button_bg_color + ', ' + button_bg_color2 + ')',
'backgroundImage': '-o-linear-gradient(top, ' + button_bg_color + ', ' + button_bg_color2 + ')'
});
}
};
$('.my-color-field').wpColorPicker(myOptions);
答案 0 :(得分:0)