Closed rothec closed 8 years ago
Hi Christian,
Thank you for the PR. Unfortunately, even though I think the idea is pretty neat, this is not something I feel should be in the plugin. I'd like to keep the plugin a bit more basic instead of catering to less experienced users. Thanks for your effort nonetheless!
Kind regards,
Jelle
Hi Jelle,
I would like to suggest an improvement for your responsive tabs solution which will make the use of tabs much easier and more comfortable for inexperienced users. You can create tab containers in a very simple way.
Example HTML code:
With this fork you can have multiple tab containers within the same page and assign the responsive tab functionality with a single line of jQuery javascript.
It is not necessery to have a list of tabs in front of the tab-panel. If the tab list does not exist, the tabMagic function automatically generate this list. It either uses the "original" IDs of the tab panels (if they exists) or tries to generate them automatically. The automatic creation of the IDs can happen in two ways: They can be provided via data-attributes (data-magictabs-id) or it automatically creates them by numbering containers and tabs sequentially. The titles of the tabs will be assigned in a similar way: The tabMagic function either looks for data-magictabs-title attribute or will look for a heading elements in the tab panel and use it as title of the tab.
What is the tabMagic functionality good for? In certain environments (like content management systems) tabbed information blocks are "assembled" from different modul outputs which are provided sequentially. When the tab container is opened it is unknown how many tabs will be provided and what their ids and what their titles will. Therefore it is not possible to create the
<ul>
-list with tab ids and title upfront before the first tab panel is inserted. With the tabMagic-functionality you can simply output one tab panel after the other and every piece of information which is required to create the<ul>
tab list is contained in the tab panels (via data-attributes) or will be added automatically if it is missing. If you do not want to worry about tab panel ids and tab titles you don't have to add them. The tabMagic function will do this for you. The ideal solution for lazy people. ;-)This solution is 100% compatibel to the existing responsive tabs solution and will work with existing tab containers.
Feel free to contact me if you have any questions: c.rothe@ruck-zuck-versand.de
Best regards
Christian