在chrome下不能显示displayblock或者inlineblock的元素怎么办?

在chrome下不能正常显示一个display: inline-block或者display: block的元素怎么办 
 demo页面只有一个输入框,当输入框有焦点时高度变大,并且显示 字数显示和回复按钮。 
 现在问题是,chrome只能在第一次刷新之后点击输入框然后高度变大并显示 字数显示和回复按钮的元素,但是再点击第二次输入框就只有高度变大,却没有看到字数显示和回复按钮的元素了(firefox正常) 

案例:人人网评论功能.comment-input{width: 450px;}.input-area{outline: 0;border: 1px solid black;width:446px;height: 15px;}.input-area_expand{height: 45px;}.input-action{display: none;}.input-action_show{height: 26px;width: 102px;display: inline-block;//这里display: block都试过了,只能在第一次刷新的时候看到,再点击第二次输入框就看不到了float: right;}

0/140回复

登录后复制

//获取下一个兄弟元素节点function getNextElement(node){      if(node.nodeType == 1){          return node;      }      if(node.nextSibling){          return getNextElement(node.nextSibling);      }      return false;}   document.getElementsByClassName('input-area')[0].onfocus = function() {this.className = 'input-area input-area_expand'var nextEl = getNextElement(this.nextSibling);nextEl.className = 'input-action input-action_show';this.value = '';console.log('focus:'+nextEl.className)}document.getElementsByClassName('input-area')[0].onblur = function() {var nextEl = getNextElement(this.nextSibling);nextEl.className = 'input-action';this.className = 'input-area'this.value = '评论……';console.log('blur :'+nextEl.className);}

登录后复制

以上就是在chrome下不能显示displayblock或者inlineblock的元素怎么办?,更多请关注【创想鸟】其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/3091793.html

(0)
上一篇 2025年3月28日 13:13:05
下一篇 2025年3月28日 13:13:12

AD推荐 黄金广告位招租... 更多推荐

发表回复

登录后才能评论