I’m using the soundcloud plugin and by default it displays the tracklist. What I need to do is using a button to toggle the visibility of that list so I edited the .js code and now it adds a button with the class “tplaylist” next to the tracklist. For some reason I can’t hide the list neither make it visibble again. With css I can set display:none; and it disappears but I can’t show it again. My code is:
$(".sc-player ol.sc-trackslist").css('display', 'none');
$(".sc-player ol.sc-trackslist").css('display', 'block');
$(".tplaylist").click(function(){
$(".sc-player ol.sc-trackslist").toggle();
});
This code for some reason has no effect over the tracklist. If I remove from the stylesheet display:none; the list is visible and what is written here in JQuery doesn’t hide it at all. I also tried the pure css solution and it doesn’t work either.
Thanks for your help!
Those elements are created after your code, so the event wasn’t attached to the elements.
You have two options:
onordelegate.onversion:onuseful docs: