我该如何修复(滚动时固定在顶部)由WordPress驱动的网站的导航菜单(如TechCrunch.com)?
#1
若要始终将导航保持在站点顶部, 请对菜单容器使用以下CSS:
left: 0;
top: 0;
position: fixed;
padding: 5px 0;
width: 100%;
text-align: center;
然后, 如果用户向下滚动, 则可以使用一些JavaScript来更改徽标大小。我建议使用jQuery库检查导航栏的位置, 以防用户滚动超过导航顶部的高度时更改其位置, 以使其保持在窗口顶部, 并且当然在用户滚动时重复整个过程。
你可以在这里找到简单易用的教程
jQuery代码需要放在你的header.php文件中, 首先通过附加jquery库<script type =” text / javascript” src =” / scripts / jquerylibrary.js”> </ script>, 然后将代码放入<script>标签也位于标题php中
来源:
https://www.srcmini02.com/64906.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_41180.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57