-1
나는 문제의 메신저 JQuery와 - 1.11.0.min.js오류가 계속 미정 변수. 나는 어디로 잘못 가고 있니?
$(function(){
//catch all clicks
$("a").click(function(){
// check if it has a #
if(this.hash){
// get rid of the # sign
var hash = this.hash.substr(1);
// get position ofd the links name
var $toElement = $("a[name="+hash+"]");
var toPosition = $toElement.position().top;
// scroll animate to postion
$("body,html").animate({
scrollTop : toPosition
},2000,"easeOutExpo");
return false;
}
});
});
뿐만 아니라 jQuery를 pluging easing.js의 ANS를 사용하여 간단한 쉽게 스크롤 효과 메신저를 만들려고하고 경우에도 뭐죠 찾을 수가 어차피 내가 난 여전히 같은 오류가 같이 그것을 시도 :
$(function(){
//catch all clicks
$("a").click(function(){
// check if it has a #
if(this.hash){
// get rid of the # sign
var hash = this.hash.substr(1);
// get position ofd the links name
var $toElement = $("a[name="+hash+"]");
var $toPosition = $toElement.position().top;
// scroll animate to postion
$("body,html").animate({
scrollTop : toPosition
},2000,"easeOutExpo");
return false;
}
});
});
는'undefined' 일을 시도 할 수 있습니다? 두 번째 예제의 첫번째 차이점에서'toPosition'을 사용하고 두 번째 예제에서'$ toPosition'을 사용하는 유일한 차이점은 무엇입니까? –
이 줄에서 오류가 발생합니다. var toPosition = $ toElement.position(). 위쪽; – Code
this.hash? 그게 뭐야? – Bilal