avalonbyeaw.comのナビゲーションに scrollTo スクリプトを正常に実装しましたが、クライアントはホームページからリンクを追加したいと考えています。簡単ですよね?ないと思います。スクロールしないだけでなく#finishes
、ナビゲーション リンクから削除した URL にも追加されます。どこかに関数へのリンクを追加する必要があるだけだと思いますか?私はそれを理解することはできません。
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>