当前位置:网站首页>Compatible with Internet Explorer

Compatible with Internet Explorer

2022-06-25 04:52:00 Kiway.

Front end small style compatible IE

Yesterday, after work, the leader sent me a screenshot with a disordered style , Then I tested it all over the popular browsers and found nothing , Then ask the leader which browser it is , He says it is 360 Browser compatibility mode , I opened it and found that these compatibilities are for IE Of , Then I sent a message 666.
 Insert picture description here
 Insert picture description here
It is the OK and Cancel buttons that go below , If I change it directly, it will affect other browsers , Only use js distinguish IE browser , And then through js change css style .
The most painful thing is 360 Browser compatibility mode , Cannot audit element , I can only download one IE Come to tune .
Finally I decided which one to change class, The construction started .
The code is as follows :

if (!!window.ActiveXObject || "ActiveXObject" in window){
    // Determine whether IE
	var class= document.getElementsByClassName('layui-layer');
	console.log(class)
	class.item(0).style.height = '';
}else{
    // Other browsers don't have to deal with it anymore 
	// console.log('fff')
}

Print element results :
IE Printed
Google Printed

There is only one print out , So I can modify it without a loop .
The main problem encountered is when reviewing elements , Be precise , And can not be changed id and class, Then there is the question of where the code should be written , I started by writing at the top , It doesn't work , Until I find the trigger js To succeed .
Final rendering :

 Insert picture description here

 Insert picture description here

原网站

版权声明
本文为[Kiway.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210533123242.html