动态 hover 使用变相使用

使用   onmouseover  和 onmouseout 代替 hover

 foreach (var menu in Model.OrderBy(x => x.Order).Where(x => x.ParentId == module.Id))
    {
        {
              <li id='cpglId' onmouseover="this.style.background='url(@menu.PicPath) no-repeat center center'" 
                  onmouseout="this.style.background='url(@menu.PicPath) no-repeat center center'"
                  
onclick="addTab('@menu.Id','@menu.Url','@menu.Name')"> @menu.Name @menu.PicPath </li> var i = 0; i++; if (i == 1) { break; } }
}

动态加载 :hover无效,只能使用方法

原文地址:https://www.cnblogs.com/youmingkuang/p/9241868.html