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

tmp
yutao 10 years ago
parent be9cf478e5
commit c92bd138bb

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

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

Loading…
Cancel
Save