Следующий мой код. Я пытаюсь прокручивать с момента нажатия кнопки отправки на new-products
. Однако приведенный ниже сценарий не работает.scrollTo плагин, похоже, не идентифицирует div
<input type="submit" value="Get Ratings" class="main-search-submit" id="go">
</div>
<div id="new-products">
</div>
<script>
$(document).ready(function(){
$(".main-search-submit").click(function() {
$.scrollTo($("#new-products"), { duration: 0});
});
</script>
<!-- Javascipt Libraries-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/1.4.11/jquery.scrollTo.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
</body>
Также CSS моего new-products
класса для целей тестирования:
#new-products {
height: 2000px;
}
Я делаю что-то не так?
EDIT: Консоль показывает ->
index.html:7 GET file://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css net::ERR_FILE_NOT_FOUND
index.html:9 GET file://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js net::ERR_FILE_NOT_FOUND
index.html:22 GET file://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js net::ERR_FILE_NOT_FOUND
index.html:23 GET file://cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/1.4.11/jquery.scrollTo.min.js net::ERR_FILE_NOT_FOUND
index.html:24 GET file://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js net::ERR_FILE_NOT_FOUND
index.html:26 Uncaught ReferenceError: $ is not defined
UPD 1: Добавление http:
, прежде чем ссылки помогли устранить ошибки консоли. Но div все еще не прокручивается.
Может быть, ваши дивы накладываются друг на друга. Сообщение css здесь. – saruftw