Easyui-tree 文本过长,鼠标悬停显示完整的信息
来源:互联网 发布:财新数据 编辑:程序博客网 时间:2024/05/22 08:02
js代码:
$('#cTreeList7811q').tree({ url:strUrl, // 数据来源地址 method:'post', animate:true, onLoadSuccess:function(node,data){ $('#cTreeList7811q').on('mouseenter','span.tree-title',function(){// console.log($(this).text()); var curZindex=$(this).parents('.window').css('z-index')+100; var itemTxt=$(this).text(); var itemWidth=$(this).width()+4; // 4像素是padding的左右值各2 var itemLeft=$(this).position().left; // node.text文本相对于父元素偏移多少 var cTreeWidth=$('#cTreeList7811q').width(); if((itemWidth+itemLeft)>cTreeWidth){ if($('body').find('.tip').length!=0){ $('body').find('.tip').remove(); }else{ var html='<div class="tip">'+itemTxt+'</div>'; $('body').append(html); $('.tip').css({'top':$(this).offset().top+15,'left':$(this).offset().left,'z-index':curZindex}); } } }); $('#cTreeList7811q').on('mouseleave','span.tree-title',function(){ if($('body').find('.tip').length!=0){ $('body').find('.tip').remove(); } }); }, onLoadError:function(){ showError("读取数据出错"); }});鼠标悬停显示完整Tip是根据弹出窗口的宽度来计算
阅读全文
0 0
- Easyui-tree 文本过长,鼠标悬停显示完整的信息
- jsp:超出字数显示省略号;鼠标悬停显示完整文本
- easyUI 鼠标悬停显示内容
- extjs 鼠标悬停显示文本
- EasyUI Datagrid 鼠标悬停显示单元格内容
- Easyui 鼠标悬停显示单元格内容
- EasyUI Datagrid 鼠标悬停显示单元格内容
- EasyUI Datagrid 鼠标悬停显示单元格内容
- Ext 鼠标悬停grid的一行显示该行信息
- jQuery鼠标悬停显示提示信息窗口
- jquery特效--鼠标悬停显示提示信息
- jQuery鼠标悬停显示提示信息窗口
- ToolTip插件,鼠标悬停时显示信息
- jquery 鼠标悬停显示信息提示框
- GridView中的每个单元格文本长度的控制,鼠标悬停时,显示单元格所有的内容
- 鼠标悬停信息提示
- Qt5制作类似QQ好友鼠标悬停显示好友信息的ToolTip
- EasyUI DataGrid 鼠标悬停提示
- OpenGL中GL_FRONT_RIGHT、GL_BACK_RIGHT等绘制缓冲的概念
- UVA
- 数学建模专栏 | 开篇:如何备战数学建模竞赛之 MATLAB 编程
- python爬虫笔记之用re及urllib库爬取
- 莫比乌斯反演的学习
- Easyui-tree 文本过长,鼠标悬停显示完整的信息
- 阿里巴巴2018年校招研发C++笔试
- poj3279 Fliptile
- 阿里校招前端笔试题小结
- 在C++中,有哪4个与类型转换相关的关键字?这些关键字有什么特点?应该在什么场合使用?
- poj1182 食物链
- 前端架构变更记
- matlab2c使用c++实现matlab函数系列教程-triu函数
- hessian入门