bug#2853:谷歌浏览器:课程讨论区:发布带有大图的内容时,没有展开两个字显示。

This commit is contained in:
yutao 2015-06-16 11:13:57 +08:00
parent 0434219518
commit e5774f5731
3 changed files with 57 additions and 9 deletions

View File

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

View File

@ -58,7 +58,31 @@
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %>
<script>
$(function(){if($("#contentmessage<%=topic.id %>").height()>182){$("#project_show_<%= topic.id%>").show();}});
//$(function(){if($("#contentmessage<%#=topic.id %>").height()>182){$("#project_show_<%#= topic.id%>").show();}});
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
$(function(){
function nh_show_btn(){
if($("#contentmessage<%=topic.id %>").height()>182){
$("#project_show_<%= topic.id%>").show();
}
}
var div = $("#contentmessage<%=topic.id %>");
var imgs = $('img',div);
var lens = imgs.length;
function nh_load_img_end(){
lens--;
if(lens <= 0){
nh_show_btn();
}
}
if(lens <= 0){
nh_show_btn();
}else{
$('img',div).load(function(){
nh_load_img_end();
});
}
});
</script>
</div>
<div class="cl"></div>

View File

@ -1,5 +1,5 @@
<style type="text/css">
div.talk_new .ke-container{margin-left:2px;}
/*div.talk_new .ke-container{margin-left:2px;}*/
/*div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
@ -135,12 +135,12 @@ function nh_init_board(params){
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var userAgent = navigator.userAgent.toLowerCase();
if(/trident/.test(userAgent)){
$("div.talk_new .ke-container").css({'margin-left':'55px'});
}else if(/chrome/.test(userAgent)){
$("div.talk_new .ke-container").css({'margin-left':'57px'});
}
//var userAgent = navigator.userAgent.toLowerCase();
//if(/trident/.test(userAgent)){
//$("div.talk_new .ke-container").css({'margin-left':'55px'});
//}else if(/chrome/.test(userAgent)){
//$("div.talk_new .ke-container").css({'margin-left':'57px'});
//}
// var toolbar = $("div[class='ke-toolbar']",params.about_talk);
// $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
// params.toolbar_container.append(toolbar);