当前博客:如何动态禁用按钮

98 次浏览【转载需注明来源】

博客作者:【Jeffrey】

个性签名:永远有一个更好的方法

如下图,如何点击<启动服务器>按钮,禁用自身激活<关闭服务器>按钮?

 

默认排序
Generic placeholder image
Generic placeholder image
qiang Time: 2023-08-02 14:05:13

可以添加类名  lay-按钮-禁用,这样按钮就无法点击,然后用jq切换这个类名。

Generic placeholder image
Jeffrey 回复 1楼 qiang Time: 2023-08-02 14:39:41

这个思路知道了,就是不知道怎么写,是把原类名替换掉还是?

Generic placeholder image
qiang 回复 2楼 Jeffrey Time: 2023-08-02 15:51:05

一般是切换添加类名。

Generic placeholder image
Jeffrey 回复 3楼 qiang Time: 2023-08-03 10:27:39

可以帮写个例子吗,还是搞不懂

Generic placeholder image
Jeffrey 回复 5楼 qiang Time: 2023-08-03 12:41:01

非常感谢,已学会


如何动态禁用按钮