bug#2915:正式版—项目讨论区:发布内容过多且带有表情时,显示不完整,也没有展开提示。

This commit is contained in:
yutao 2015-06-24 16:12:45 +08:00
parent be9cf478e5
commit c92bd138bb
2 changed files with 36 additions and 18 deletions

View File

@ -70,26 +70,35 @@
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug //解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
$(function(){ $(function(){
function nh_show_btn(){ function nh_show_btn(){
if($("#project_show_<%= topic.id%>").is(':hidden')){
if($("#contentmessage<%=topic.id %>").height()>182){ if($("#contentmessage<%=topic.id %>").height()>182){
$("#project_show_<%= topic.id%>").show(); $("#project_show_<%= topic.id%>").show();
} }
} }
}
var div = $("#contentmessage<%=topic.id %>"); var div = $("#contentmessage<%=topic.id %>");
var imgs = $('img',div); var imgs = $('img',div);
var lens = imgs.length; var lens = imgs.length;
function nh_load_img_end(){ function nh_load_img_end(){
lens--;
if(lens <= 0){
nh_show_btn(); nh_show_btn();
// lens--;
// if(lens <= 0){
// nh_show_btn();
// }
} }
} if(lens > 0){
if(lens <= 0){
nh_show_btn();
}else{
$('img',div).load(function(){ $('img',div).load(function(){
nh_load_img_end(); nh_load_img_end();
}); });
} }
nh_show_btn();
// if(lens <= 0){
// nh_show_btn();
// }else{
// $('img',div).load(function(){
// nh_load_img_end();
// });
// }
}); });
</script> </script>
<div class="project_board_content break_word" id="content_<%=topic.id%>"> <div class="project_board_content break_word" id="content_<%=topic.id%>">

View File

@ -62,26 +62,35 @@
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug //解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
$(function(){ $(function(){
function nh_show_btn(){ function nh_show_btn(){
if($("#project_show_<%= topic.id%>").is(':hidden')){
if($("#contentmessage<%=topic.id %>").height()>182){ if($("#contentmessage<%=topic.id %>").height()>182){
$("#project_show_<%= topic.id%>").show(); $("#project_show_<%= topic.id%>").show();
} }
} }
}
var div = $("#contentmessage<%=topic.id %>"); var div = $("#contentmessage<%=topic.id %>");
var imgs = $('img',div); var imgs = $('img',div);
var lens = imgs.length; var lens = imgs.length;
function nh_load_img_end(){ function nh_load_img_end(){
lens--;
if(lens <= 0){
nh_show_btn(); nh_show_btn();
// lens--;
// if(lens <= 0){
// nh_show_btn();
// }
} }
} if(lens > 0){
if(lens <= 0){
nh_show_btn();
}else{
$('img',div).load(function(){ $('img',div).load(function(){
nh_load_img_end(); nh_load_img_end();
}); });
} }
nh_show_btn();
// if(lens <= 0){
// nh_show_btn();
// }else{
// $('img',div).load(function(){
// nh_load_img_end();
// });
// }
}); });
</script> </script>
</div> </div>