透明滤镜导致overflow:visible变为hidden

IE滤镜与布局问题
本文探讨了在Internet Explorer浏览器中使用透明滤镜时遇到的布局问题,特别是如何影响`overflow:visible`属性的行为,并对比了与其他现代浏览器的差异。
如下:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312"/>
<style>
*{
margin:0px;
padding:0px;
}
#d01{
/*IE有滤镜的时候这里会被当作hidden,导致显示区域被剪切,而其它浏览器没有这种情况*/
/*另外补充一点,在IE下,不触发layout,透明滤镜不会生效*/
overflow:visible;
position:absolute;
background:red;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);
opacity:0.5;
width:100px;
height:100px;
}
#d02{
position:absolute;
}
</style>
</head>
<body>
某些情况下,透明滤镜会使overflow:visible变成overflow:hidden,详细如下 (另外,IE下div会向左排列,其余浏览器都是换行...IE真是个奇怪的东西)
<div id="d01">
<div id="d02">
<img src="http://khm2.google.cn/kh/v=41&x=13492&y=6207&z=14&s=Gal">
</div>
</div>
</body>
</html>

请帮我检查为什么UpOutlined不显示/** * @Date: 2023-12-20 09:59:06 * @LastEditTime: 2024-01-09 18:22:35 * @FilePath: \工作\xinsheng-chasiwu-legacy-front\src\h5\components\Detail\modules\VideoSummaryH5\index.js * @Description: 智能视频摘要 * @ * @Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. */ import { useState } from 'react'; import PropTypes from 'prop-types'; import SvgIcon from '@src/components/SvgIcon'; import css from './style.m.css'; import eventBus from '@src/utils/eventBus'; import { useLocalStorage } from '@src/components/Detail/modules/VideoPlayer/modules/VideoSummary/summaryHooks'; import { getNls, locale } from '@src/utils/i18n'; import { useEffect } from 'react'; const dict = getNls('components_LiveDetail_modules_Content_modules_Summary'); import { useTypeWriterHooks } from '@src/components/Detail/modules/VideoPlayer/modules/VideoSummary/summaryHooks.js'; import { DownOutlined, UpOutlined } from '@ant-design/icons'; const isEn = locale === 'en'; /** * @description: 添加回放视频下方的评论组件的class * @param {number} type 0 添加 1 删除 * @return {*} */ const addCommentsClass = ({ seth5VideoHeight, h5VideoHeight, type = 0 }) => { const commentDom = document.querySelector('#content-main .ev_tab_container'); if (!commentDom) return; if (type === 1) { commentDom.classList.remove('live-comments-top'); } else if (!commentDom.classList.contains('live-comments-top')) { commentDom.classList.add('live-comments-top'); if (seth5VideoHeight) seth5VideoHeight(h5VideoHeight + 56); // 兼容包含视频字幕的场景 } }; function renderContent(props) { const { aiSummaryTitle, aiSummaryContent, aiSummaryContentEn } = props; return ( <div className={`${css.summaryContent} h5ap-font-14`}> <div className={css.summaryContentWidth}> <div className={`${css.label} h5ap-font-14`}>{aiSummaryTitle}</div> <div className={css.description}>{isEn ? aiSummaryContentEn : aiSummaryContent}</div> </div> </div> ); } function VideoSummaryH5(props) { const { videoId, videoUuids, columnType, seth5VideoHeight, h5VideoHeight } = props; const [isNotFirstClosed, setIsNotFirstClosed] = useLocalStorage(videoUuids, 'isNotFirstClosed'); const [isFirstClosed, setIsFirstClosed] = useState(isNotFirstClosed); // 首次是否关闭 const [visible, setVisible] = useState(false); const [showAll, setShowAll] = useState(false); // 展示全部 // 获取ai摘要的相关内容 const { aiSummaryTitle, aiSummaryContent, aiSummaryContentEn, keyWordsTitle, keyWordsContent, isShowGenerateBtn, keyList, keyListEn, } = useTypeWriterHooks(props); let params = { aiSummaryContent, aiSummaryContentEn, keyWordsTitle, keyWordsContent, showAll, setShowAll }; params = { ...params, aiSummaryTitle, isShowGenerateBtn, keyList, keyListEn }; const click = () => { eventBus.emit(`showFloatWindow${videoId}`, true); setIsFirstClosed(true); setIsNotFirstClosed(true); if (columnType !== 'live') return; addCommentsClass({ seth5VideoHeight, h5VideoHeight, type: 1 }); }; useEffect(() => { eventBus.removeAllListeners(`evt_showSummaryH5`); eventBus.on(`evt_showSummaryH5`, (value) => { setVisible(value); if (columnType !== 'live') return; if (!isFirstClosed && value) { addCommentsClass({ seth5VideoHeight, h5VideoHeight }); } else { addCommentsClass({ seth5VideoHeight, h5VideoHeight, type: 1 }); } }); return () => { eventBus.removeAllListeners(`evt_showSummaryH5`); }; }, []); if (isFirstClosed || !visible) return null; return ( <div className={`${css.videoSummaryH5} video-summary-h5 ${locale === 'en' ? css.summaryH5En : ''}`}> <div className={css.summaryH5Notice}> <div className={css.summaryH5Left}> <SvgIcon iconClass="summaryIcon" svgClass={css.svg} /> <div className={css.title}>{dict.aiSummary}</div> </div> <div className={css.summaryH5Right}> <SvgIcon iconClass="close" {...{ click }} /> </div> </div> <div className={css.summaryH5}> {renderContent(params)} {/* 展开/收起图标,绝对定位在右下角 */} <span className={css.expandIcon} {...{ onClick: () => { setShowAll(!showAll); }, }} style={{ position: 'absolute', right: 0, bottom: 0, width: '20px', height: '20px', display: 'flex', alignItems: 'center', justifyContent: 'center', pointerEvents: 'none', // 允许点击穿透到父容器 zIndex: 1, }} > {showAll ? <UpOutlined style={{ fontSize: '16px' }} /> : <DownOutlined style={{ fontSize: '16px' }} />} </span> </div> </div> ); } VideoSummaryH5.propTypes = { videoId: PropTypes.string, videoUuids: PropTypes.string, columnType: PropTypes.string, seth5VideoHeight: PropTypes.func, h5VideoHeight: PropTypes.number, }; export default VideoSummaryH5;
最新发布
10-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值