-1

看看我为代理机构开发的这个网站。

http://oakinteractive.co/

我使用 localScroll 插件在各个部分之间滚动。他们要求我添加另一个部分,无论出于何种原因,该插件似乎被忽略了。单击“每日灵药”,然后单击“提交”。而不是滚动到该部分,它只是跳转到它并且哈希出现在 URL 中。在其他任何链接上都不会发生这种情况。

这是用于调用滚动的代码,其中突出显示了新部分:

$('#navContainer, #navShindigs, #navTidbits, #navBarnburners, #navLegend, #shindigs, **#recipeForm**').localScroll({
        target: '#contentViewport',
        easing: 'easeOutSine'
});

这是该部分的链接:

<a href="#recipeForm"><img id="submit_elixir" src="grfx/submit.png" /></a>

这是部分:

 <div id="recipeForm">
      <section id="section_recipe">
            <fieldset>
                  <h2>Submit a Recipe</h2>
                  <form id="mailform" name="contact" method="post" action="inc/procMail.php">
                  <label for="yourName">Your Name</label><input type="text" name="yourName" id="yourName" value="" />
                  <label for="yourEmail">E-mail Address</label><input type="text" name="yourEmail" id="yourEmail" value=""/>
                  <label for="yourMessage">Your Recipe</label><textarea name="yourMessage" id="yourMessage" rows="3"></textarea>
                  <input type="image" name="Send Recipe" alt="Send Recipe" class="sendEmail" src="grfx/submit_button.png" />
                  </form>
            </fieldset>
      </section>
</div>

网站上的所有其他 jQuery 代码都可以工作,包括滚动所有其他元素。只是这个添加的部分似乎被忽略了。

任何人都可以阐明或提供任何见解吗?我以前从未遇到过 scrollTo 或 localScroll 插件的问题。

4

1 回答 1

0

我在另一双眼睛的帮助下发现了这个问题。我需要包含选择器#elixir,而不是包含选择器#recipeForm。看看#photobooth 也是一样。localScroll 调用中的选择器都是容器,而不是结束元素。有时很难看到选择器中还列出了一些结束元素。

于 2014-04-21T16:34:56.017 回答