html核心代码
<select name="leixing" lay-filter="leixing">
<option value="xxxxx">xxxxx</option>
<option value="lastten">最近十位</option>
<option value="xxxxx">xxxxx</option>
<option value="xxxxx">xxxxx</option>
<option value="xxxxx">xxxxx</option>
<option value="xxxxx">xxxxx</option>
<option value="xxxxx">xxxxx</option>
<option value="xxxxx">xxxxx</option>
</select>
JavaScript核心代码
var form = layui.form;
form.on('select(leixing)', function(data){
if(data.value == 'lastten'){ //如果选择“最近十位”
window.open('../last_ten/','_self'); // 直接跳转
document.getElementById("fangfa").style.display = "none"; //可用以隐藏
document.getElementById("neirong").style.display = "none"; //可用以隐藏
document.getElementById("buttons").style.display = "none"; //可用以隐藏
}else{
document.getElementById("fangfa").style.display = "block"; //可用以显示
document.getElementById("neirong").style.display = "block"; //可用以显示
document.getElementById("buttons").style.display = "block"; //可用以显示
}
});
参考资料:
https://www.cnblogs.com/tine/p/8257304.html
https://blog.csdn.net/weixin_30715523/article/details/99783895
https://cloud.tencent.com/developer/article/1409115
版权属于:soarli
本文链接:https://blog.soarli.top/archives/563.html
转载时须注明出处及本声明。