samsono / Easy-Responsive-Tabs-to-Accordion

Easy responsive tabs - is a lightweight jQuery plugin which optimizes normal horizontal or vertical tabs to accordion on multi devices like: web, tablets, Mobile (IPad & IPhone). This plugin adapts the screen size and changes its action accordingly.
Other
604 stars 259 forks source link

New option 'tabidentify' throws an error when left as the default (blank) #61

Open jeffbobish opened 9 years ago

jeffbobish commented 9 years ago

Error:

Uncaught Error: Syntax error, unrecognized expression: ul.resp-tabs-list.

The extra period at the end is being added even if tabidentify is empty (which is the default option):

$respTabs.find('ul.resp-tabs-list.' + options.tabidentify)

techkey commented 9 years ago

I have confirmed this using jQuery-2.1.4 and Easy-Responsive-Tabs-to-Accordion-master of 2015-05-27.

The error is thrown in jQuery but caused by easyResponsiveTabs.js on line 36:

33 //Main function
34 this.each(function () {
35     var $respTabs = $(this);
36     var $respTabsList = $respTabs.find('ul.resp-tabs-list.' + options.tabidentify); //<-- Error
37     var respTabsId = $respTabs.attr('id');
38     $respTabs.find('ul.resp-tabs-list.' + options.tabidentify + ' li').addClass('resp-tab-item').addClass(options.tabidentify);
39     $respTabs.css({
40        'display': 'block',
41        'width': jwidth
42    });
N3m3 commented 8 years ago

Any Updates on this? Getting the same Error.

Uncaught Error: Syntax error, unrecognized expression: ul.resp-tabs-list
$.fn.extend.easyResponsiveTabs  @   jquery.responsive.tabs.js:34
(anonymous function)
sunnywz commented 8 years ago

Also getting this error:

Error: Syntax error, unrecognized expression: ul.resp-tabs-list.

thrown from ....jquery.js?ver=1.11.3

DavidNGood commented 8 years ago

ccgjosh wrote about a fix here:

https://github.com/samsono/Easy-Responsive-Tabs-to-Accordion/issues/70

The reason this happens is that tabidentify is defined as '' by default. To fix pass a class name and add that class to both resp-tabs-list and resp-tabs-container -- $('.tabs').easyResponsiveTabs({ tabidentify: 'vert' });

<ul class="resp-tabs-list vert"> ... </ul> <div class="resp-tabs-container vert"> ... </div>

davidgebbett commented 7 years ago

I have created a permament fix for this issue - without the need to add a class or tab indentifier

The JS file has been added to my repository as I couldn't see a way to post the fixes to this repository - https://github.com/davidgebbett/Tabs-to-Accordian