MP3-jPlayer: skip to minutes by clinking the timeline

MP3-jPlayer: skip to minutes by clinking the timeline

On this page I have the MP3-jPlayer WordPress plugin with the Text Skin, slightly modified.

I have deleted the volume bar from the plugin’s html/php structure. I have also added a “seekbar”:

 
  1. <div class="seekbar-wrapper">
  2. <div class="seekbar-container">
  3. <div class="seekbar" value="0" max="1"></div>
  4. </div>
  5. </div>

I have modified the plugin’s mp3-jplayer-2.7.js file in order to show, for every track (mp3 files), the timeline. After line 403 (jQuery(this.eID.indiM + j).empty().append('<span class="Smp3-tint tintmarg"></span> ' + this.Tformat(pt));) I have added:

 
  1. var sbContainerWidth = $('.seekbar-container').width();
  2. var progValue = pt / tt * 100;
  3. var progPercentage = progValue + '%';
  4. $('#mp3jWrap' + '_' + this.tID).closest('li').find('.seekbar').width(progPercentage);

The result of this is the presence of a progress bar that was missing before.

I have tried to make the seekbar react to a click event and update the track’s "timer:

 
  1. var sbContainerWidth = $('.seekbar-container').width();
  2. function skip(ev) {
  3. pt = ev.pageX - $('.seekbar-container').offsetLeft;
  4. }

But unfortunately it does not react to the clicking (and the timeline does not update).

Why? Where is the mistake?