It's pretty hard to tell what might be wrong without seeing the actual page.
But a couple of questions and a suggestion...
 
Is "sreturn false:" a typo in your message, or is that the actual code?
 
Also, I assume there is some other code that sets the initial click handler?
 
Anyway, you don't need the complication of binding and unbinding the click
handler on every click. A single click handler for both states would be much
simpler. For example:
 
$(function() {
    var playing = false;
    $("#playbta").bind("click",function(){
        if( playing )
            player.dostop();
        else
            player.doplay(pos);
        playing = ! playing;
        return false;  // you may not need this
    });
});
 
You may want to have the "playing" state set from events coming back from
your media player, but that's a separate issue.
 
-Mike



  _____  

My script:

function stop()
{
    $("#playbta").unbind("click").bind("click",function(){
        play(pos);
        sreturn false;
    });
    
    player.dostop();
}

function play(pos)
{
    $("#playbta").unbind("click").bind("click",function(){
        stop();
        return false;
    });
  player.doplay(pos);
}

it's piece of my music player...

When user click on "play" button, text on button change on "pause" and event
"click" (of button) most change on "play(pos);return false;"...
In all browsers all good...event of button change successfully..
but IE try execute event o_O

for example:
when I execute function "play", IE execute "stop(); return false;" too...
o_O and I have eternal cycle :( because IE execute stop(),stop() execute
play() and so on....

how it's correct?!
p.s.sorry for my English
----

I using last jQuery


Reply via email to