0
我使用2個不同的jquery插件,這兩個工作正常,但由於某種原因,我不能讓他們一起工作。jquery全屏圖像與jquery卷軸
全屏圖像:
<script type="text/javascript">
var FullscreenrOptions = { width: 1024, height: 439, bgID: '#bgimg' };
// This will activate the full screen background!
jQuery.fn.fullscreenr(FullscreenrOptions);
</script>
滾動到DIV功能:
function GotoSection(divid)
{
$('#realBody').animate({scrollTop: $('#' + divid).offset().top}, 300);
}
我的html:
<!-- This is the background image -->
<img id="bgimg" src="img/background6.jpg" />
<!-- Here the "real" body starts, where you can put your website -->
<div id="realBody">
<div id="header">
<div class="content">
<img src="img/logo.png" align="left"/>
<ul id="menu">
<li><a id="mhome" name="home" class="selected" onclick="GotoSection('home');">Home</a></li>
</ul>
<div class="clear"></div>
</div>
</div>
<div id="container">
<div id="home" class="seperator"></div>
here is my home content
</div>
</div>
</div>
我的CSS:
#bgimg {
position:absolute;
z-index: -1;
}
#realBody{
position:absolute;
z-index: 5; /* Place the new body above the background image */
overflow:auto; /* restore scrollbars for the content */
height:100%;width:100%; /* Make the new body fill the screen */
top:120px;
}
body
{
height: 100%;
overflow: hidden;
background-color: #ffffff;
padding: 0;
margin: 0;
font-family:'HelveticaLTStdLight';
color:#0f508e;
}
滾動是搞砸了,它不會去我發送的div。我認爲我的錯誤是在這一行:
$('#realBody').animate({scrollTop: $('#' + divid).offset().top}, 300);
但不知道我需要改變它。