layer官方API默认右边按钮=右上角X按钮,点击=关闭弹窗
此方法最终效果是右上角X保留关闭弹窗功能,并且右边按钮能设置(location.href="") 等
之前试过的写法(错误):
layer.confirm('想去哪个网站?',{btn:['新浪','百度']},function(index){layer.close(index);location.href="http://" rel="external nofollow" rel="external nofollow" ; })以上这篇layer.confirm()右边按钮实现href的例子就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。