根本不動(dòng),console(dragStartScrollPosition),console (dragContBarRate)結(jié)果一直是0
根本用不了啊,是我看不懂代碼,還是講師要誤人子弟啊???代碼我基本上是一個(gè)字一個(gè)字對(duì)照了兩邊,不是報(bào)錯(cuò),就是根本不動(dòng),加了那么多this,到底是什么玩意啊
return Math.max(this.$cont.height(),this.$cont[0].scrollHeight)-this.$cont.height();
this.$cont.height() =?this.$cont[0].scrollHeight 一直相等?dragContBarRate =0 一直等于0
2016-08-06
對(duì),就是吧原本的???? contSelector?? : ".scroll-wrap",?? ?? 改成???????? contSelector?? : ".scroll-cont",
2016-08-06
你的問題可能是實(shí)例化中傳入的參數(shù)有問題,視頻中老師更改了contSelector: '.scroll-content',你可以改一下
2016-08-06
這是一種面向?qū)ο蟮木幊趟枷?,首先要了解this,然后再看視頻會(huì)輕松很多