<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; HTA: слайд-шоу с музыкальным сопровождением]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=3021&amp;type=atom" />
	<updated>2009-04-08T18:43:58Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=3021</id>
		<entry>
			<title type="html"><![CDATA[HTA: слайд-шоу с музыкальным сопровождением]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=21508#p21508" />
			<content type="html"><![CDATA[<p>Запускать из папки с рисунками. Если в папку закинуть mp3-файл, он будет проигрываться во время слайд-шоу. Желательно, чтобы размер рисунков соответствовал текущему разрешению экрана. Рисунки будут бесконечно чередоваться в случайном порядке.<br /></p><div class="codebox"><pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Слайдшоу&lt;/title&gt;
&lt;hta:application applicationname=shideshow version=1.0
    caption=no sysmenu=no scroll=no scrollflat=no
    innerborder=no border=thin borderStyle=normal
    singleinstance=yes showintaskbar=yes
    minimizebutton=yes maximizebutton=no windowstate=maximize
    selection=no contextmenu=yes navigable=no&gt;
&lt;meta http-equiv=msthemecompatible content=yes&gt;
&lt;style&gt;
    body{margin:0px;cursor:crosshair;}
    #image{width:100%;height:100%;filter:revealTrans(duration=1.5,transition=23)}
&lt;/style&gt;
&lt;script&gt;
fso=new ActiveXObject(&#039;Scripting.fileSystemObject&#039;);
allfiles=new Enumerator(fso.getFolder(&#039;.&#039;).files);
imagefiles=new Array();
musicfiles=new Array();
window.document.onkeydown=stop;
window.onload=init;
function init() {
 countFiles();
 if(musicfiles.length)
 music.src=musicfiles[Math.ceil(Math.random()*musicfiles.length)-1];
 start();
}
function stop() {if(event.keyCode==27)window.close();else alert(&#039;Для выхода нажмите ESC    &#039;);}
function start() {
 image.filters.revealTrans.transition=Math.ceil(Math.random()*24)-1;
 image.filters.revealTrans.Apply();
 image.src=imagefiles[Math.ceil(Math.random()*imagefiles.length)-1];
 image.filters.revealTrans.Play();
 setTimeout(&quot;start()&quot;,3000);
}
function countFiles() {
 while(!allfiles.atEnd()) {
  file=allfiles.item();
  switch(fso.getExtensionName(file.path).toLowerCase()){
   case&#039;jpeg&#039;:case&#039;jpg&#039;:case&#039;png&#039;:case&#039;gif&#039;:case&#039;bmp&#039;:imagefiles[imagefiles.length]=file.name;break;
   case&#039;mp3&#039;:case&#039;wav&#039;:case&#039;wave&#039;:musicfiles[musicfiles.length]=file.name;break;
  }
  allfiles.moveNext();
 }
 if(!imagefiles.length){alert(&#039;\nВ текущей директории риунки не найдены!\n\nЗапустите программу из папки с рисунками.  \n\nПоддерживаемые форматы: JPG, BMP, GIF и PNG.\n\n&#039;);close();}
}
&lt;/script&gt;
&lt;bgsound id=music loop=-1&gt;
&lt;/head&gt;
&lt;body&gt;&lt;img id=image&gt;&lt;br&gt;&lt;/body&gt;
&lt;/html&gt;</code></pre></div><p>Автор решения — <strong>medium</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2009-04-08T18:43:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=21508#p21508</id>
		</entry>
</feed>
