最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

關(guān)于最后一節(jié)的問題

function sameSign(a,b){

return (a ^ b)>=0;

}



function vector(a,b) {

return{

x:b.x-a.x,

y:b.y-a.y

}

}


function vectorProduct(v1,v2) {

return v1.x * v2.y-v2.x * v1.y;

}


function isPointInTrangle(p,a,b,c){

var pa=vector(p,a);

var pb=vector(p,b);

var pc=vector(p,c);


var t1=vectorProduct(pa,pb);

var t2=vectorProduct(pb,pc);

var t3=vectorProduct(pc,pa);


return sameSign(t1,t2)&&sameSign(t2,t3);

}


function needDelay(elem,leftCorner,currMousePos){

var offset=elem.offset();


var topLeft={

x:offset.left,

y:offset.top

}


var bottomLeft={

x:offset.left,

y:offset.top+elem.height()

}


return isPointInTrangle(currMousePos,leftCorner,topLeft,bottomLeft);

}

我運(yùn)行時(shí)候一直顯示

function vector(a,b) {

return{

x:b.x-a.x,

y:b.y-a.y

}

}

這個(gè)里面的x不能是undefined的屬性?

正在回答

4 回答

我也遇到了這個(gè)問題,然后回頭再看一遍,找出了兩個(gè)問題:

  1. #test 的第一個(gè)mouseenter方法下的第二行代碼為:$(document).bind('mousemove',moveHanlder);開始寫的unbind

  2. 第二個(gè)就是我下面多謝了一個(gè)timer = setTimeout(function(){......}

0 回復(fù) 有任何疑惑可以回復(fù)我~

我也是遇到同樣的問題,x是undefined,,請(qǐng)問這是怎么回事

0 回復(fù) 有任何疑惑可以回復(fù)我~

function vector(a,b){

return{

? ?x: b.x - a.x;

y: b.y - a.y

}

}

為什么總是報(bào)錯(cuò)

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

慕田峪354622

return 時(shí)的對(duì)象的屬性之間用,隔開 不用;
2017-05-24 回復(fù) 有任何疑惑可以回復(fù)我~

方法本身沒有問題,可能是你傳的p,a,b,c對(duì)應(yīng)的實(shí)參currMousePos,leftCorner,topLeft,bottomLeft坐標(biāo)有問題,可以打印出來瞅瞅。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

關(guān)于最后一節(jié)的問題

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)