I want customize standart template playlist in wordpress with this answer, and I could it: i added one more field description on template.
<script type="text/html" id="tmpl-wp-playlist-current-item">
<# if ( data.image ) { #>
<img src="{{ data.thumb.src }}"/>
<# } #>
<div class="wp-playlist-caption">
<span class="wp-playlist-item-meta wp-playlist-item-title">“{{ data.title }}”</span>
<# if ( data.meta.album ) { #><span class="wp-playlist-item-meta wp-playlist-item-album">{{ data.meta.album }}</span><# } #>
<# if ( data.meta.artist ) { #><span class="wp-playlist-item-meta wp-playlist-item-artist">{{ data.meta.artist }}</span><# } #>
<# if ( data.description ) { #><a class="wp-playlist-item-meta wp-playlist-item-description">Song text</a><# } #>
</div>
**<# if ( data.description ) { #>
<div class="wp-playlist-item-description-text">{{ data.description }}</div>
<# } #>**
</script>
And I applyed some css style with this div:
.wp-playlist-item-description-text {
position: absolute;
width: 350px;
z-index: 1;
background: #FFF;
padding: 10px;
margin-left: 20px;
border: 1px solid #eee;
height: auto !important;
}
That I see:
But I cant applyed some jQuery scripts to my code and my tags. I want can show/hide this element with click, but Crome say me, that cant find it: zero elements found by selector.
jQuery(function ($) {
$(".wp-playlist-item-description").click(function(){
$('.wp-playlist-item-description-text').slideToggle();
});
});
Can you help me please, guys?