在chrome下不能显示displayblock或者inlineblock的元素怎么办?
在chrome下不能正常显示一个display: inline-block或者display: block的元素怎么办
DEMO页面只有一个输入框,当输入框有焦点时高度变大,并且显示 字数显示和回复按钮。
现在问题是,chrome只能在第一次刷新之后点击输入框然后高度变大并显示 字数显示和回复按钮的元素,但是再点击第二次输入框就只有高度变大,却没有看到字数显示和回复按钮的元素了(firefox正常)
<head> <meta charset="UTF-8"> <title>案例:人人网评论功能</title> <style>.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;} </style></head><body><p class="comment-input" style="border:1px solid red"> <textarea class="input-area" > 评论……</textarea><p class="input-action" style="border:1px solid red"><span class="inputed">0</span>/<span class="maxlength">140</span><a href="javascript:void(0)" class="reply-btn">回复</a></p></p></body>
//获取下一个兄弟元素节点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的元素怎么办?,更多请关注php中文网其它相关文章!

熱AI工具

Undress AI Tool
免費脫衣圖片

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Stock Market GPT
人工智慧支援投資研究,做出更明智的決策

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

IfChromeusestoomuchmemoryorrunsslowly,trythesesteps:1.UseShift EsctoopenTaskManagerandendhigh-memorytabsorextensions.2.Disableorremoveproblematicextensions.3.Enablehardwareaccelerationinsettings.4.UpdateChrometothelatestversion.5.ResetChromesettingst

IfChromeshows"Yourprofilecouldnotbeopenedcorrectly,"trythesesteps:1.RestartChrome.2.DeletetheSingletonLockfileinUserData.3.RenametheDefaultfoldertoDefault_Backup.4.LaunchChromewith--disable-extensions.5.Createanewuserprofile.6.ReinstallChro

EnsurehardwareaccelerationisenabledinChromesettingsandenable"Overridesoftwarerenderinglist"inchrome://flags,thenrestartthebrowser.2.UpdateorreinstallyourgraphicsdriversviaDeviceManageronWindowsorsystemupdatesonMac.3.Disableconflictingextens

關閉多餘擴展、限制後台活動、調整硬件加速設置可降低Chrome耗電量。首先關閉不必要擴展,進入chrome://extensions/禁用或卸載資源佔用高的插件;其次在系統設置中開啟“限制後台擴展程序活動”並使用插件掛起不活躍標籤頁;最後根據設備情況嘗試關閉硬件加速以減少GPU負載,若效果良好則可長期保持該設置。

TomanageWebsitePermmissingOogLechrome:1.Gotosettings>私密和security> siteSettings.2.Controlaccessforcamera,location and.3.allow,block,block,block,orresetpermissionsforspecificsites.4.useincognitomodemodemodemodemoderempolocorary cristructer rucding rucdiders browsing。

disableTabGroupsByVisitingChrome:// flags,搜索“ tabGroups”,settreal flagstodisabled,andrestartingChrome.2.ManalyGrouTabsbySbyDraggingTheMoutofthemofthemofthemofthemofthegroup,threthertherthertherthertheright-clickungrouption,orassigningingingingingingIndingIndividualTabStonogroup.3.avoidAigroup.3.avoidaigoida.3.avoida.3.avoida.3.avoida.3.avoida.3.avoidaa

TochangeChrome'SdownLoadLocation,GotoSettings>私有服務>下載,thenclick“更改” tosetanewfolder.ternestelationalsy,啟用“ AskWheretoSave” toChooseeachTime.quicklyAccessSettingssettingsbyTypytyptyptyptyptyControme:// settings/nettings/settings/settings/settings/settsInthead

ThecameralightturnsoninChromebecauseawebsiteorappisactivelyaccessingyourcamera,evenifyou'reunaware.2.Commonreasonsincludevideocalls,livepreviews,facefilters,orsecurityverification.3.Tocheckwhichsiteisusingthecamera,lookforacameraiconorlocksymbolinthe
