-1
I’m trying to put a button on next episode, it’s working normal, the problem is that it appears in the movies, where it should only appear in episodes of series. I tried to solve the error by making the class of the button return a value that would only appear if it was in "Episodes", if it was elsewhere it would return "Array", so I tried to use the css so when it has "Array" in the class it would hide the button with the display: One, but did not work and gave error: Uncaught Syntaxerror: Unexpected token 'Else'
If anyone can help I’d appreciate it
Note: use the Wordpress theme "Dooplay" version 2.4.1
Code:
player.once('play', () => {
<?php
$postmeta = doo_postmeta_episodes($postid);
$tmdbids = doo_isset($postmeta,'ids');
$temporad = doo_isset($postmeta,'temporada');
$episode = doo_isset($postmeta,'episodio');
$episode_pagi = DDbmoviesHelpers::EpisodeNav($tmdbids,$temporad,$episode);
$next_episode = doo_isset($episode_pagi,'next');
$link_next = !empty($next_episode) ? $next_episode['permalink'].'" title="'.$next_episode['title'].'"' : 'href="#" class="nonex"';
?>
$('.jw-media').append(`<a class="<?php echo $postmeta ?>" target="_parent" href="<?php echo $link_next ?>" id="proximoep">Próximo Episódio <i class="fas fa-forward"></i></a>`);
});
player.on('time', e => {
let duration = player.getDuration();
let currentTime = Math.floor(e.position);
if(currentTime > duration - 120){
$('#proximoep').hasClass('Array');
$('#proximoep').css('display', 'none');
} else {
$('#proximoep').css('display', 'inline-block');
} else {
$('#proximoep').css('display', 'none');
}
});
Your
if
has twoelse
. That doesn’t make much sense.– Woss
I understand, you know some way to fix this, or you could recommend me some documentation on, I’ll be very grateful
– DarkShadow ULS