Good day. Tell me how to implement something like playing music on the site and user playlists like this: http://tidido.com/RU/RU At the moment there is a script that allows you to run music in the background, when you navigate through the pages everything works, and how to adapt it for the above task.
$$r(function() { $$i({ create:'script', attribute: { 'type':'text/javascript', 'src':'http://nagon.net/modules/NRMSLib/NRMSLib.js' }, insert:$$().body, onready:function() {//выполняю только после загрузки скрипта $$e.add($$('mp3button'),'click',playmp3rand);//добавляю событие кнопке после загрузки скрипта } }); }); var playmp3rand = function (event) { //запукаю случайную музыку modules.sound.stop();//останавливаю если что то уже играет switch($$s.randnum(1,3)) {//случайное число от 1 до 3 включительно case 1: modules.sound.start({'music': 'http://goldenland.onfind.net/2/1/'+$$s.randnum(1,8)+'.mp3'}); break; case 2: modules.sound.start({'music': 'http://goldenland.onfind.net/2/2/'+$$s.randnum(1,12)+'.mp3'}); break; case 3: modules.sound.start({'music': 'http://goldenland.onfind.net/2/3/'+$$s.randnum(1,4)+'.mp3'}); break; } $$('sound_s_el_m').$$('width','1px').$$('height','1px').$$('overflow','hidden');//эти параметры трогать не нужно }