引导3 + backbonejs - 的toogle NAV不开放 [英] Bootstrap 3 + backbonejs - Toogle nav not opening

查看:136
本文介绍了引导3 + backbonejs - 的toogle NAV不开放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jQuery,backbonejs,underscorejs和引导3为我的项目(​​ https://izify.com/ )。这是我的源$ C ​​$ C https://github.com/datomnurdin/izify-template 。单击该按钮时,我无法打开的toogle导航。

I am using jquery, backbonejs, underscorejs and bootstrap 3 for my project (https://izify.com/). This is my source code https://github.com/datomnurdin/izify-template. I can't open toogle nav when click the button.

这是对的toogle导航屏幕截图。

This is screenshot for toogle nav.

我offcanvas.js

My offcanvas.js

$(document).ready(function() {
  $('[data-toggle=offcanvas]').click(function() {
    $('.row-offcanvas').toggleClass('active');
  });
});

有没有当backbonejs集成任何问题吗?

Is there any problem when integrate with backbonejs?

我把模板从这里, http://getbootstrap.com/examples/offcanvas/

示范网站: http://staging.revivalx.com/izify-template/

非常感谢在前进。

推荐答案

如何ABT this..cleaner方式

how abt this..cleaner way

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;

});

这篇关于引导3 + backbonejs - 的toogle NAV不开放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆