Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 在asp.net c中单击按钮时更改样式表的css类属性#_Jquery_Html_Asp.net_Css - Fatal编程技术网

Jquery 在asp.net c中单击按钮时更改样式表的css类属性#

Jquery 在asp.net c中单击按钮时更改样式表的css类属性#,jquery,html,asp.net,css,Jquery,Html,Asp.net,Css,在页面上我想用户可以改变页面的背景,应用背景图像到页面。保存时,单击此更改的背景应保存在css类中 假设我的css类是 #content { background:green; } 如图所示,若我选择蓝色,那个么蓝色应该应用于该页面背景 在“保存”按钮上,单击css应更改为 #content { background:blue; } 您可以使用: $('#saveButtonId').click(function() { $('#content').css('ba

在页面上我想用户可以改变页面的背景,应用背景图像到页面。保存时,单击此更改的背景应保存在css类中

假设我的css类是

#content 
{
    background:green;
}
如图所示,若我选择蓝色,那个么蓝色应该应用于该页面背景

在“保存”按钮上,单击css应更改为

#content 
{
    background:blue;
}
您可以使用

$('#saveButtonId').click(function() {
    $('#content').css('background','blue');
})
在jquery中使用css()


如果未动态加载,则可以使用:

 $("#id").click(function ()
 {
    $('#content').css('background','blue');
 });
如果是动态加载的:

$(document).on( "click", "#id", function() {
  $('#content').css('background','blue');
});

您需要在用户配置文件中存储背景吗?并在他重新登录时提供相同的背景信息?
$(document).on( "click", "#id", function() {
  $('#content').css('background','blue');
});