So here is my opinion:
$(function() { var ImageManipulation = Backbone.View.extend({ el: $('body'), tagName: "img", events: { 'mouseover img': 'fullsize', 'click img#current': 'shrink' }, initialize: function() { _.bindAll(this, 'render', 'fullsize', 'shrink'); //var message = this.fullsize; //message.bind("test", this.fullsize); }, render: function() { }, fullsize: function() { console.log("in fullsize function"); console.log(this.el); $('.drop-shadow').click(function() { console.log(this.id); if (this.id != 'current') { $('.individual').fadeIn(); $(this).css('position', 'absolute'); $(this).css('z-index', '999'); $(this).animate({ top: '10px', height: '432px', }, 500, function() { this.id = "current"; console.log("animation complete"); return true; }); }; }); }, shrink: function() { $('.individual').fadeOut(); $('#current').animate({ height: '150px', }, 500, function() { this.id = ""; $(this).css('position', 'relative'); $(this).css('z-index', '1'); console.log("animation complete"); return true; }); } }); var startImages = new ImageManipulation(); });
I donβt understand how to change el so that 'this' takes on the click function that I have in full size. I would prefer the jQuery function to be removed and the mouseover function to be deleted with another click, but I cannot figure out how to assign 'this' to the specific image click. Hope my question makes sense.
source share