Note that there are some explanatory texts on larger screens.

plurals
  1. POneed single click event in multiple playlists
    text
    copied!<p>i am using fancy music player in my website and i have multiple playlists in the format below </p> <pre><code>&lt;div class="playlist"&gt; &lt;a href="mysong.mp3" class="fmp-my-track add_link"&gt;add this song&lt;/a&gt; &lt;a href="mysong.mp3" class="fmp-my-track add_link"&gt;add this song&lt;/a&gt; &lt;a href="mysong.mp3" class="fmp-my-track add_link"&gt;add this song&lt;/a&gt; &lt;/div&gt; &lt;div class="playlist"&gt; &lt;a href="mysong.mp3" class="fmp-my-track add_link"&gt;add this song&lt;/a&gt; &lt;a href="mysong.mp3" class="fmp-my-track add_link"&gt;add this song&lt;/a&gt; &lt;a href="mysong.mp3" class="fmp-my-track add_link"&gt;add this song&lt;/a&gt; &lt;/div&gt; &lt;div class="playlist"&gt; &lt;a href="mysong.mp3" class="fmp-my-track add_link"&gt;add this song&lt;/a&gt; &lt;a href="mysong.mp3" class="fmp-my-track add_link"&gt;add this song&lt;/a&gt; &lt;a href="mysong.mp3" class="fmp-my-track add_link"&gt;add this song&lt;/a&gt; &lt;/div&gt; </code></pre> <p>i want when user click first time on any link in one playlist then it clears the playlist and on next clicks it adds the songs in playlist for example when user click any link from first playlist it clears the playlist and add the song in playlist and on next clicks within this playlist it will not clear the playlist. when user click on any link from other playlist same here first time it will clear the playlist and then it will add the songs..i am using the code below to achieve this but it does not work</p> <pre><code>$(".playlist").each(function(){ $(".add_link").one("click", function(){ $.fancyMusicPlayer.clear(); }); $(".add_link").click(function(){ $.fancyMusicPlayer.addTrack(this.href, this.title, this.target,false); }); }); </code></pre> <p>adding the song in playlist is working fine but the functionality of clearing the playlist on first click is not working.if any one can help me.</p> <p>Thanks in advance!!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload