Reputation: 25545
Error from firebug:
missing ) after condition
[Break on this error] else if (($(this).parent...nt().hasClass('plaing')==true) ) {
The code:
$(".myButtonPlay").live('click',function(){
if ($(this).parent().parent().hasClass('current')==false){
console.log($(this).children().attr('src'));
var media=$(this).parent().parent().attr('media');
var id=$(this).parent().parent().attr('id');
$(this).parent().parent().addClass('plaing');
$(this).find('img').attr('src','http://localhost:8000/silver/images/btn_pause.gif')
play_media(media, id);
}
else if (($(this).parent().parent().hasClass('current')==true) $$ ($(this).parent().parent().hasClass('plaing')==true) ) {
$(this).parent().parent().removeClass('plaing');
$('#mediaPlayer').attr('player').pause();
$(this).find('img').attr('src','http://localhost:8000/silver/images/btn_pause.gif');
}
else if ( ($(this).parent().parent().hasClass('current')==true) $$ ($(this).parent().parent().hasClass('plaing')==false) ){
$(this).find('img').attr('src','http://localhost:8000/silver/images/btn_paly.gif');
$(this).parent().parent().addClass('plaing');
$('#mediaPlayer').attr('player').play();
}
});
Where is the problem? Looks like error is in conditions of second if
statement....
Upvotes: -1
Views: 398
Reputation: 538
$$ is not a valid operator. Reading your code it seems like you were trying to use the && operator.
Upvotes: 0
Reputation: 51640
Unless I'm missing something, $$
is not an operator... maybe you meant &&
?
Upvotes: 6