gpt4 book ai didi

jquery - iframe 在悬停时展开和收缩

转载 作者:太空宇宙 更新时间:2023-11-04 00:00:02 25 4
gpt4 key购买 nike

我在 iframe 中有一个成员下拉菜单。

iframe 的大小取决于变量,因此当用户将鼠标悬停在按钮上时,需要将高度 100%、宽度 100%,以便可以看到任何必要的信息。

iframe 需要从高度 50px、宽度:300px 到 100%、100%。

这样当菜单不在下拉列表中时,其他父页面链接将起作用。

也就是类似

<iframe id="parent".....><ul><li class="drop_item">button1</li><li class="drop_item">button2</div></ul></iframe>

“Parent”需要在悬停“drop_item”时展开。

希望这是有道理的。

最佳答案

我不确定你是否明白 <iframe> 的意思- iframe 用于在您页面的“框”内显示来自另一个 url 的内容,它必须有一个 src链接到其他页面的属性。 (正如@MrLister 所说 - 其标记中的内容仅在浏览器不支持 iframe 时显示)您应该尝试使用 <div>而是像这样:

<div id="parent".....><ul><li class="drop_item">button1</li><li class="drop_item">button2</div></ul></div>

然后应用这个 CSS代码(在这种情况下不需要 jQuery):

#parent{
width:300px;
height:50px;
}

#parent:hover{
width:100%;
hieght:100%;
}

**注意这些CSS如果您决定继续使用 iframe,规则也应该有效

关于jquery - iframe 在悬停时展开和收缩,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17135078/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com