diff options
author | fuxiaohei <fuxiaohei@vip.qq.com> | 2014-09-25 21:52:58 +0800 |
---|---|---|
committer | fuxiaohei <fuxiaohei@vip.qq.com> | 2014-09-25 21:52:58 +0800 |
commit | 7c30ae7002f203aac1841fefdf535b0d017aabbf (patch) | |
tree | dbbf215903c63e7c4838522ba68b20ed11e61a27 /public/ng/js/lib/tabs.js | |
parent | 089d934547c88a8c3c7ce5587fcc2481cc98f3a3 (diff) |
is utils improvement
Diffstat (limited to 'public/ng/js/lib/tabs.js')
-rw-r--r-- | public/ng/js/lib/tabs.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/public/ng/js/lib/tabs.js b/public/ng/js/lib/tabs.js deleted file mode 100644 index 98216720..00000000 --- a/public/ng/js/lib/tabs.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Created by fuxiaohei on 14-6-26. - */ - -function Tabs(selector) { - - function hide($nav) { - console.log("hide", $nav); - $nav.removeClass("js-tab-nav-show"); - $($nav.data("tab-target")).removeClass("js-tab-show").hide(); - } - - function show($nav) { - console.log("show", $nav); - $nav.addClass("js-tab-nav-show"); - $($nav.data("tab-target")).addClass("js-tab-show").show(); - } - - var $e = $(selector); - if ($e.length) { - // pre-assign init index - var $current = $e.find('.js-tab-nav-show'); - if ($current.length) { - $($current.data("tab-target")).addClass("js-tab-show"); - } - // bind nav click - $e.on("click", ".js-tab-nav", function () { - var $this = $(this); - // is showing, not change. - if ($this.hasClass("js-tab-nav-show")) { - return; - } - $current = $e.find(".js-tab-nav-show").eq(0); - hide($current); - show($this); - }); - console.log("init tabs @", selector) - } -}
\ No newline at end of file |