我已经在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