我正在准备一个注册页面,允许用户通过在其客户端中选择来源来插入照片。该按钮必须转换为所选图像。
谢谢
最佳答案
使用javasript和CSS
$('#button').click(function(){
if($(this).hasClass('HasImage'))
{
$(this).addClass('RemoveImage').removeClass('HasImage');
}
else
{
$(this).addClass('HasImage').removeClass('RemoveImage');
}
});
CSS
.HasImage{background: url('path of image') }
.RemoveImage{background: url('path of image')}
关于jquery - 如何通过单击按钮并将按钮变成使用 jQuery 选择的图像来接受图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28713723/