Such a question, put the script Radio Stream on the site.

Now this zapara: you need to hide the block, but the music continues to play. But this is not a task, as soon as the block becomes Dislay:none , it immediately stops playing.

Tried $("#radio").slideToggle(); It does not help either. How to be? Desirable beautiful ...

  • and visibility: hidden doesn't help either? - zloctb
  • Can I somehow change the top (css) property smoothly so that one button has appearance and disappearance? - Sexy Girl
  • If a code or link was provided to the site where it is located - it would be easier to help :) - iKuzko
  • Um ... if you were more attentive, it would be easier for you ... Since the very first line shows the link - Sexy Girl

5 answers 5

Not sure about the result, but I think you can try this

 <style> #radio{ overflow-y: hidden; height: 50px; /* Или какая там высота блока? */ } </style> <script> // скрытие блока function showOrHideRadio() { if($("#radio").css("height") == "0px") { $("#radio").animate({"height":"50px"});//Или какая там высота? } else { $("#radio").animate({"height":"0px"}); } } </script> <input type="button" onclick="showOrHideRadio()" value="Скрыть/Показать"> 
  • Thank you (+ you for this) for trying to help. But it helped me more, if it happened when you pressed one button, it changed, that is: there is one button, for opening and hiding. toggle or whatever ... does not work - Sexy Girl
  • Well, it's simple. I edited my example, now it hides and shows) - Pavel Vershinin
  • Thank you)))) I implemented it the same way myself) And then I come in the same way) - Sexy Girl

Well, if you can not play with display:none , then you can try to do it ugly. Remove the element from the document stream - do it position: absolute , and then bring it out of the working area - left: -5000 .

    Apparently, slideToggle() assigns display:block|none .

    And if visiblity:visible|hidden is assigned to a hidden block, then the probability that the music will continue to play.

    ZY Unfortunately, I cannot test this example and give a concrete answer!

    • That's right, but I need to make visiblity: visible | hidden beautifully ... about the same as slideToggle () - Sexy Girl

    style.position.top allows access to the top property.

    setinterval allows setinterval to ensure smoothness.

      And you can not just make it transparent

       $("#radio").css("opacity", "0") 
      • No, it is impossible, since it blocks other blocks, but there is an opacity to use, then there is no difference whatsoever, access to the blocks that are under it is still absent. - Sexy Girl