jellekralt / Responsive-Tabs

Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.
http://jellekralt.github.io/Responsive-Tabs/
MIT License
531 stars 228 forks source link

Reload a tab on clicked. #41

Closed mikezclements closed 9 years ago

mikezclements commented 9 years ago

I'm so very thankful that you made this amazing plugin but may I asked a question. I'm trying to add some codes to enable the tabs to reload once clicked. I add this line of code

activate: function(clicked) { location.reload(false); }

unfortunately once I run the code the page keeps on reloading again and again. Hope you can help me. Thank you.

jellekralt commented 9 years ago

Hi, I'm glad you like the plugin :). The page keeps reloading because the activate function runs on first load, because when loaded, the first tab is opened. If you want this to work you could add a check so that when the activate function is run for the first time, the location.reload doesn't run.

mikezclements commented 9 years ago

Good day,

Finally solve this, I fix it by adding onClick="window.location.reload() attribute on link of tab title.

Thank you.