Есть вот такой код
window.Market.VideoLiner = function(place, options=null) {
if (!(place instanceof window.jQuery) || !place.length) {
throw new window.Error('place is not jQuery object.')
}
this.options = Object.assign(window.Market.VideoLiner.options, options||{})
this.place = place
this.line = place.children(this.options.line_selector)
this.next_selector = this.options.next_selector
this.prev_selector = this.options.prev_selector
this.next = $(this.next_selector)
this.prev = $(this.prev_selector)
this.position = 0
return this
}
Но, когда созадю прототип, просто не видит его.
если в созданный прототип записать
var p = 545
console.log('p',p)
тупо не выводит, что не так? Я признаться не могу понять.
window.Market.VideoLiner.prototype.activate = function() {
this.activate_ui()
}
window.Market.VideoLiner.options = {
listener_selector: 'body',
next_selector: '.liner-next',
prev_selector: '.liner-prev',
main_page_selector : '#wrapper #top .rows',
line_selector: '.liner-line',
division_selector: 'div.box.blocks',
division_width: 310,
window_division: 1,
division_step: 1
}
window.Market.VideoLiner.activate = function(){
var main_page = $(window.Market.VideoLiner.options.main_page_selector)
if (!main_page.length == true) {
return null
}
var dom = main_page.find('.boxs .box-liner .liner')
new window.Market.VideoLiner($(dom))
}