简体   繁体   English

CSS在Material Design Lite和Drift之间的冲突

[英]CSS Conflict between material design lite and Drift

I want to use the zoom capacity of Drift.js ( https://github.com/imgix/drift ) inside a webapp using material design lite ( https://getmdl.io/ ) and I can't get it to work. 我想使用材质精简版( https://getmdl.io/ )在Web应用程序中使用Drift.js( https://github.com/imgix/drift )的缩放功能,但我无法使其正常工作。 I was able to narrow it down to a css issue, but I'm kind of stuck here. 我能够将其范围缩小到一个css问题,但是我有点卡在这里。

Here are 2 fiddles, the only technical difference is that in the second one, the material design lite css is absent. 这里有2个小提琴,唯一的技术区别是在第二个中,没有材料设计lite css。

The first fiddle: https://jsfiddle.net/mbitard/b41g2f0y/ 第一个小提琴: https : //jsfiddle.net/mbitard/b41g2f0y/

new Drift(document.querySelector('img'), {
        paneContainer: document.querySelector('p'),
        inlinePane: true,
        inlineOffsetY: 0,
        containInline: true
});

The second fiddle: https://jsfiddle.net/qankkgLe/2/ 第二个小提琴: https : //jsfiddle.net/qankkgLe/2/

The zoom on the first fiddle doesn't work. 放大第一个小提琴不起作用。

It appears that the <main> element has a greater z-index than the zoom. 看来<main>元素的z索引大于缩放。

By adding z-index: 100; 通过添加z-index: 100; to .drift-zoom-pane.drift-inline { css class I can zoom again. .drift-zoom-pane.drift-inline { CSS类,我可以再次缩放。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM