I looked over our jsfiddle and played with it for a little bit and I believe I have found why the script isn't working properly for you.
The issue I have found is your list items formatting. You are using ul->a->li and the proper format is ul->li->a
So by changing:
<a><li tab="tab2" data-icon="">Tab2</li></a>
<li tab="tab2" data-icon=""><a>Tab2</a></li>
Should fix the problem as it did in jsfiddle.