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
603 stars 258 forks source link

JS is not up to scratch #64

Open entozoon opened 9 years ago

entozoon commented 9 years ago

Firstly, why is there a random:

console.log('here');

In the JS file? You can't just leave logs in to annoy people.

Secondly, everywhere that you've referred to elements by doing things like:

$respTabs.find('.resp-accordion.' + options.tabidentify)

Causes errors and doesn't work if the option is empty. Which is obviously because of how you couldn't similarly do:

$respTabs.find('.resp-accordion.')

You need to have some serious if statements going on there to get the behaviour you're after, to inject the second . only if necessary.

PersyJack commented 9 years ago

Yeah I was wondering while it was giving errors when I call the function without options. I had to debug it and found the same thing.

entozoon commented 9 years ago

@PersyJack I ended up using this instead https://github.com/jellekralt/Responsive-Tabs

PersyJack commented 9 years ago

@entozoon thanks for the link. I initially removed the dots from the classes and added tabidentify = options.tabidentify != '' ? '.' + options.tabidentify:'' before the main function, which changes the default tabidentify to the one set by user options. I also replaced every instance of options.tabidentify to tabidentify After all, I decided to use fakewaffle-responsive-tabs. It's half the size, allows you to use bootstrap and pretty simple:

https://github.com/openam/bootstrap-responsive-tabs