我已經在nav上成功實現了scrollTo腳本avalonbyeaw.com,我的客戶希望添加主頁上的鏈接。很簡單,對吧?我猜不會。它不僅不會滾動,還會將#finishes
添加到我們從導航鏈接中刪除的網址中。我猜我只需要添加鏈接到某個地方的功能?我無法弄清楚。scrollTo插件不滾動鏈接以外的鏈接
的Javascript
$(document).ready(function() {
$('a.panel').click(function() {
$('a.panel').removeClass('selected');
$(this).addClass('selected');
current = $(this);
$('#wrapper').scrollTo($(this).attr('href'), 800);
return false;
});
$(window).resize(function() {
resizePanel();
});
});
function resizePanel() {
width = $(window).width();
height = $(window).height();
mask_width = width * $('.item').length;
$('#debug').html(width + ' ' + height + ' ' + mask_width);
//$('#wrapper, .page').css({width: width, height: height});
//$('#stage').css({width: mask_width, height: height});
$('#wrapper').scrollTo($('a.selected').attr('href'), 0);
}
工作導航鏈接的HTML
<div id="nav-finishes" class="nav"><a href="#finishes" class="panel panel-finishes" alt="finishes"><img src="images/spacer.gif" height="10" width="79" border="0" /></a></div>
非工作的鏈接添加到piecemaker XML提要
<Text><p>Avalon by EAW features automotive-class finishes on all trim pieces. <a href="#finishes" class="panel">Optional premium enclosure finishes</a> set these systems in a class by themselves.</p></Text>
啊,如果我拼寫正確,將會有所幫助。它鏈接,但它不動畫。仍然無法確定這一部分。任何人? – 2012-07-13 21:19:28
你知道如何從flash內部訪問js環境嗎? – Fresheyeball 2012-07-13 21:27:42
所發生的一切就是你的鏈接有標準的行爲。 – Fresheyeball 2012-07-13 21:29:28