gpt4 book ai didi

jquery - 向上滑动页脚

转载 作者:太空宇宙 更新时间:2023-11-03 21:49:56 25 4
gpt4 key购买 nike

我想在悬停时制作一个向上滑动的页脚,并在页面底部粘贴一个页脚。我设法粘贴页脚并使其表现得像一个按钮,但它不会在悬停时向上滑动以显示页脚的内容。

这是我的代码:

<html>
<head>
<meta charset='UTF-8'>
<title>sliding footer</title>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>

<style>
html, body {
height:100%;
width:100%;
margin:0;
padding:0;
}

.slide {
border:1px solid black;
width:100%;
height:150px;
display:none;
position:absolute;
left: 0px;
right:0px;
bottom: 25px;
}

.footer {
position:absolute;
bottom: 0px;
height:25px;
width: 100%;
left: opx;
right: 0px;
border:1px solid black;
display: inline-block;
overflow: hidden;
cursor:pointer;
background:#FFE4E1;
}
</style>
</head>


<body>

<script type="text/javascript">

$(".footer").hover(function () {
$(this).children('.slide').slideToggle("fast");
});

</script>

<div class="footer" >
Footer Button
<div class="slide">

<a href="#"> footer content 1</a>
<a href="#"> footer content 2</a>
<a href="#"> footer content 3</a>

</div>
</div>

</body>
</html>

最佳答案

我更改了一些我不需要的 css JSFIDDLE并使其看起来略有不同。

JS:

 $(".footer").hover(function () {
$(".slide").slideToggle("fast");
});

HTML:

<div class="footer" > 
<div class="slide">
<a href="#"> footer content 1</a>
<a href="#"> footer content 2</a>
<a href="#"> footer content 3</a>
</div>
Footer Button
</div>

CSS:

.slide { 
border:1px solid black;
height:125px;
left: 0px;
right:0px;
bottom: 25px;
display: none;
position: absolute;
}

.footer {
position:absolute;
bottom: 0px;
height:25px;
width: 100%;
left: opx;
right: 0px;
border:1px solid black;
display: inline-block;
cursor:pointer;
background:#FFE4E1;
}

关于jquery - 向上滑动页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18132646/

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