我在我的项目中使用 jquery、backbonejs、underscorejs 和 bootstrap 3 (https://izify.com/ https://izify.com/)。这是我的源代码https://github.com/datomnurdin/izify-template https://github.com/datomnurdin/izify-template。单击按钮时无法打开切换导航。
这是切换导航的屏幕截图。
我的offcanvas.js
$(document).ready(function() {
$('[data-toggle=offcanvas]').click(function() {
$('.row-offcanvas').toggleClass('active');
});
});
和backbonejs集成有什么问题吗?
我从这里获取模板,http://getbootstrap.com/examples/offcanvas/ http://getbootstrap.com/examples/offcanvas/
演示站点:http://staging.revivalx.com/izify-template/ http://staging.revivalx.com/izify-template/
这个怎么样..更干净的方式
define(['jquery', 'underscore','backbone','text!templates/home/homeTemplate.html'], function($, _, Backbone, homeTemplate){
var HomeView = Backbone.View.extend({
el: $("#page"),
events: {
'click [data-toggle=offcanvas]' :'toggleClass'
},
render: function(){
this.$el.html(homeTemplate);
},
toggleClass: function (e) {
this.$('.row-offcanvas').toggleClass('active');
}
});
return HomeView;
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)