本文介紹了如何檢測(cè) Chrome Inspect Element 是否正在運(yùn)行?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!
問(wèn)題描述
有什么方法可以檢測(cè) Chrome Inspect Element 窗口是否正在運(yùn)行?
Is there any way to detect whether the Chrome Inspect Element window is running?
例如,如果用戶在 Chrome 中單擊檢查元素",則窗口會(huì)顯示 Hello World
警報(bào).
For example if the user clicks "Inspect Element" in Chrome, the window shows a Hello World
alert.
這可能嗎?
推薦答案
window.onresize = function(){
if((window.outerHeight-window.innerHeight)>100)
alert('hello');
}
實(shí)際操作:http://jsbin.com/ediquk/
請(qǐng)注意,resize 事件似乎被觸發(fā)了兩次,因此您應(yīng)該檢查您是否已經(jīng)提醒了用戶.
Note that it seems like the resize event gets fired twice, so you should check whether you alerted the use already.
這篇關(guān)于如何檢測(cè) Chrome Inspect Element 是否正在運(yùn)行?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!