最贊回答 / 蛋黃醬
在_initDomEvent函數里已經定義過this.$slider = $(opts.sliderSelector); ??this.$slider并不是options對象的屬性,而是用$(opts.sliderSelector)獲取的值
2016-10-10
其實我想說的是聽不懂的很多是跟自身的知識層面有很大的關系,就像我每次聽不懂時,我就會先擱置在哪,等過上一定的時間(在這段時間又充實了自己),再回頭來看,發現這樣效果真的好很多啦!所以更多的問題還是在自身,希望小伙伴們能正視一下這個問題,不要一味認為是老師的問題。
2016-10-10
源碼:https://github.com/Mqleaf/Practice-in-IMOOC/tree/master/1%20scrollbar
2016-10-01
鼠標移動到滾動條上面,滾動滾輪,內容跟滾動條是沒法滾動的,self.$cont.on 改成self.$cont.parent().on 就可以了
2016-09-30
varcontHeight=this.$cont[0].scrollHeight,contParentHeight=this.$cont.parent().height(),barHeight=this.$bar[0].scrollHeight;var sliderHeight = (contParentHeight*barHeight)/contHeight;if(contHeight <= contParentHeight){ return;}else{ this.$slider.css("height",sliderHeight + "px");}
2016-09-29