直接用cdn写个实例
<html><head>
<meta http-equiv="Content-Type" content="text/html charset=utf-8"/>
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/2.1.2/jquery.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/layer/3.0.3/layer.min.js"></script>
</head>
<style>
.link {
color: #0a8ddf
cursor: pointer
}
</style>
<script>
layer.open({
title: '测试',
content: '<a class="link">点击关闭跳转</a>',
success: function (layero, index) {
$(layero).find('.link').click(function () {
layer.close(index)
window.location.href = 'http://www.baidu.com/'
})
}
})
</script>
</html>