$(function () { $('.mdui-list').on('click','li',function(){ var href = $(this).children('a').attr('href'); console.log(href); if(href.lastIndexOf(".mp4") > -1) { layer.open({ type: 1, title: decodeURI(href.substring(href.lastIndexOf("/") + 1, href.length)), shadeClose: true, shade: 0.8, area: ['100%', '100%'], content: '
' }); return false; } }); });