Wait for transition to finish

Wait for transition to finish

I am trying to wait for transition to finish before calling a function that shows a title:

  1. $('#imagepackwrapper div[id^="packimgdiv"] img').on('doubletap click', function() {
  2. // newtitle == "#packtitlediv1"
  3. $('#imagepackwrapper div[id^="packimgdiv"] img').not(this).slideUp(600);  // Hide other images
  4.     function myshow(newtitle) {  // Show the title
  5.       $(newtitle).css({'margin-left': toffset + 'px','width': twd + 'px'});
  6.       console.log('Opacity: ' + $(newtitle).css('opacity'));
  7.       $(newtitle).animate({
  8.         opacity: 1
  9.       }, 800);
  10.     }   
  11.     $(this).transition({  // run transition plugin on selected image - works
  12.       marginTop: '0em',
  13.       skewX: '0',
  14.       rotateX: '0',
  15.       rotate: '0',
  16.       perspective: '0'
  17.     }, 1500);
  18.     $(this).on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() {           
  19.       myshow();
  20.     });
  21. });

  22. HTML:
  23. <div id="imagepackwrapper">
  24.   <div id="packimgdiv1">
  25.     <div class="centered_image">
  26.       <img class="imageStyle" src="files/image_18.png" width="200" height="200">
  27.     </div>
  28.     <div id="packtitlediv1" style="background-color: rgba(0, 0, 0, 0.2);"><span>Title2</span>
  29.     </div>
  30.   </div>
  31. </div>
  32.  

The function myshow never runs.  What am I doing wrong?
Thanks.