This function does not work..can’t figure out why…no errors…but the image does not shrink when I click it.
image_element.addEventListener( "click", function( )
{
this.style.width = ( parseInt( this.style.width ) - 1 ) + 'px';
this.style.height = ( parseInt( this.style.height ) - 1 ) + 'px';
}, false );
this, in the context of an eventListener, is the element [that raised the event]. An issue you might have is thatthis.style.widthmay not be specified yet…Log/alert the value of
this.style.widthand see what’s in there in the first place.