我做了这个脚本:我如何放大/缩小我的网站,而不影响部分
<script>
$(document).ready(function() {
var huser = window.screen.availHeight;
var wuser = window.screen.availWidth ;
var scr_zoom = Math.round((wuser*69)/1280);
document.body.style.zoom = scr_zoom + "%"
document.head.style.zoom = scr_zoom + "%"
});
</script>
,根据用户的屏幕大小缩放的我的网页。它工作正常,但问题是,在我的导航:
<div id="panel">
<ul class="nav">
<a href="#section1"><li id="hm">home</li></a>
<a href="#section2"><li id="abt">about</li></a>
<a href="#section3"><li id="wk">work</li></a>
</ul>
</div>
我还袭击菜单滑块:
$(function() {
$('ul.nav a').bind('click',function(event){
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500,'easeInOutExpo');
event.preventDefault();
});
});
而且这个定义我的部分:
.section{
margin:0px;
height:1000px;
width:100%;
float:left;
/* text-shadow:1px 1px 2px #f0f0f0; */
overflow:hidden;
z-index:29;
}
每次我点击“工作”部分或“关于”它只是幻灯片的错误到不同的位置。 任何想法为什么发生这种情况?
你可以看到这个问题,在这里:
http://testedesignfranjas.tumblr.com/
我发现迄今...
在滑块的这行:scrollTop的:$($ anchor.attr('href'))。offset()。top它只是不会像预期的那样滑动,我的东西锚点是错误的计算。
PS:网站不工作以及在Firefox ... :(
玉家伙,我看到了什么是错的,我只需要一点点你的帮助......在滑块的这段台词:scrollTop:$($ anchor.attr('href'))。offset()。顶部 它只是不按预期滑动,我的&锚是beeing错误的计算。 – gn66
滚动顶部的链接在哪里? –
我应该让你知道你的网站无法正常使用Firefox。菜单或菜单手柄不会出现在屏幕上。我只设法使这项工作与Chrome。 –