Skip to content

Commit

Permalink
优化demo (#330)
Browse files Browse the repository at this point in the history
* 优化demo

为tab中navbar和tabbar里标签添加点击事件交互,方便查看实际效果
  • Loading branch information
karlew authored and progrape committed Apr 19, 2016
1 parent 14ee030 commit 3a6eaf7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion dist/example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ $(function () {
className: 'navbar',
render: function () {
return $('#tpl_navbar').html();
},
bind: function () {
$('#container').on('click', '.weui_navbar_item', function () {
$(this).addClass('weui_bar_item_on').siblings('.weui_bar_item_on').removeClass('weui_bar_item_on');
});
}
};

Expand All @@ -198,6 +203,11 @@ $(function () {
className: 'tabbar',
render: function () {
return $('#tpl_tabbar').html();
},
bind: function () {
$('#container').on('click', '.weui_tabbar_item', function () {
$(this).addClass('weui_bar_item_on').siblings('.weui_bar_item_on').removeClass('weui_bar_item_on');
});
}
};

Expand Down Expand Up @@ -271,4 +281,4 @@ $(function () {
}
})
}
});
});
12 changes: 11 additions & 1 deletion src/example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ $(function () {
className: 'navbar',
render: function () {
return $('#tpl_navbar').html();
},
bind: function () {
$('#container').on('click', '.weui_navbar_item', function () {
$(this).addClass('weui_bar_item_on').siblings('.weui_bar_item_on').removeClass('weui_bar_item_on');
});
}
};

Expand All @@ -198,6 +203,11 @@ $(function () {
className: 'tabbar',
render: function () {
return $('#tpl_tabbar').html();
},
bind: function () {
$('#container').on('click', '.weui_tabbar_item', function () {
$(this).addClass('weui_bar_item_on').siblings('.weui_bar_item_on').removeClass('weui_bar_item_on');
});
}
};

Expand Down Expand Up @@ -271,4 +281,4 @@ $(function () {
}
})
}
});
});

0 comments on commit 3a6eaf7

Please sign in to comment.