Skip to content

Instantly share code, notes, and snippets.

@craigmaslowski
Created December 28, 2012 23:47
Show Gist options
  • Save craigmaslowski/4403216 to your computer and use it in GitHub Desktop.
Save craigmaslowski/4403216 to your computer and use it in GitHub Desktop.
Backbone View For Controlling an IFrame
IFrame = Backbone.View.extend({
initialize: function () {
_.bindAll(this);
},
navigate: function (route) {
this.$el.attr('src', window.location.href + route);
return this;
},
show: function () {
this.$el.show();
return this;
},
hide: function () {
this.$el.hide();
return this;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment