You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...to this: this._thumbcontent._thumbcontainer.append('<button class="' + options.thumbItemClass + '"><img src="' + this._thumbcontent[i].attr('src') + '" alt="' + this._thumbcontent[i].attr('alt') + '" /></button>');
(the double quotes on button class was missing).
and this: var index = $(e.target).parent().is(this._thumbcontent._thumbcontainer) ? $(e.target).index() : $(e.target).closest('.'+options.thumbItemClass).index();
...to this: var index = $(e.target).parent().is(this._thumbcontent._thumbcontainer) ? $(e.target).index() : $(e.target).closest('.'+options.thumbItemClass.replace(/\s+/g, ".")).index();
(preparing the selector to get more then one class)
The problem was solved an additional classes now is working:
Also, there is an bug when using more then one thumbContainerClass — it makes the carousel scroll to the last item if clicking on the container but not on items.
To fix that i added .replace(/\s+/g, ".") to the thumbContainerClass selector, turning the code to this:
Hi there.
There is a bug when you try to add more then one class to the thumb item selector ('owl-thumb-item').
On js:
thumbItemClass: 'owl-thumb-item class2 class3 class4',
They are created like this:
<button class="owl-thumb-item" class2="" class3="" class4="">...</button>
To fix that problem, i edited some lines on the original js:
this line:
this._thumbcontent._thumbcontainer.append('<button class=' + options.thumbItemClass + '><img src="' + this._thumbcontent[i].attr('src') + '" alt="' + this._thumbcontent[i].attr('alt') + '" /></button>');
...to this:
this._thumbcontent._thumbcontainer.append('<button class="' + options.thumbItemClass + '"><img src="' + this._thumbcontent[i].attr('src') + '" alt="' + this._thumbcontent[i].attr('alt') + '" /></button>');
(the double quotes on button class was missing).
and this:
var index = $(e.target).parent().is(this._thumbcontent._thumbcontainer) ? $(e.target).index() : $(e.target).closest('.'+options.thumbItemClass).index();
...to this:
var index = $(e.target).parent().is(this._thumbcontent._thumbcontainer) ? $(e.target).index() : $(e.target).closest('.'+options.thumbItemClass.replace(/\s+/g, ".")).index();
(preparing the selector to get more then one class)
The problem was solved an additional classes now is working:
<button class="owl-thumb-item class2 class3 class4"></button>
(and thanks for this great Owl extension, btw!)
The text was updated successfully, but these errors were encountered: