crashmaster Posted February 5, 2009 Share Posted February 5, 2009 I dont know, where this topic should I post... Hi there, I have index.php which every 60 seconds does AJAX request (checking if user has a new messages), and if response is positive AJAX inputs into HIDDEN <div> (style="display:none") => iframe, where is mp3 player is.. But the problem is: if <div> is hidden - sound doesn't play if <div> isn't hidden - it's shows IFRAME where I can see player, and the sound is played.. Any idea's how to play sound on background without showing hidden div and iframe ?? HTML: <body> <div id="play_sound" style="display:none"></div> ... {JS code} </body> {JS code} is: function check_updates() { var RESP = $.ajax({ type: 'post', url : '/pages/ajax/check_updates.php', cache: false, async: false }).responseText; if (RESP != ''){ $('#play_sound').html('<iframe src="http://www.dnbstep.cz/pages/ajax/play_sound.php" border="0" width="0" height="0"></iframe>'); } setTimeout("check_updates()",60000); } setTimeout("check_updates()",60000); PLAY_SOUND.php CODE is: <embed src="../../files/prehravac/player.swf" width="300" height="100" allowscriptaccess="always" allowfullscreen="true" flashvars="file=../../alarm.mp3&autostart=true" /> Btw: all PATH's are good. Link to comment https://forums.phpfreaks.com/topic/143867-hidden-div-and-iframe-play-sound-on-bg/ Share on other sites More sharing options...
deadlyp99 Posted February 6, 2009 Share Posted February 6, 2009 What about, instead of hiding the div, changing it to 0px by 0px, and no opacity? Link to comment https://forums.phpfreaks.com/topic/143867-hidden-div-and-iframe-play-sound-on-bg/#findComment-756144 Share on other sites More sharing options...
landavia Posted February 7, 2009 Share Posted February 7, 2009 above reply make sense.. but i suggest u use 1.. <div id="play_sound" style="width:1;Height:1"></div> hmmm.. nice reply deadlyp99 Link to comment https://forums.phpfreaks.com/topic/143867-hidden-div-and-iframe-play-sound-on-bg/#findComment-756465 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.