假设从1.html跳转至2.html的子页面,则:
①在1.html中添加点击事件:
<a href="/user/customerManageNew" class="u_btn_add"><span class="swf_add"></span >******</a>
②然后在后台controller中,
@RequestMapping(value = "/customerManageNew")
public ModelAndView customerManageNew(){
ModelAndView mv =new ModelAndView();
mv.addObject("Flag", "1");
mv.setViewName("/nv/client/customer_manage");
return mv;
}
③在2.html中添加一个隐藏的组件,用来存放flag的值:
<span id="Flag" th:text="${Flag}" style=display:none></span>
④在2.html中添加执行方法,根据flag的值判断是否显示子页面:
$(function(){
var flag = $("#Flag").text();
if(flag=="1"){
$(".g_cover").show();
$(".m_layer_box").show();
}