| Автор
| Сообщение |
|
|
|
Цитата |
|
| Хочу в HTML вставить кнопку при нажатии которой проиграется .WAV файл. Как это сделать? Сделал <a href='..'> но открывается панель Media Player, но мне этого не нужно... |
|
| В начало |
|
 |
|
|
 |
VaDima
Энтузиаст

Возраст: 36
Знак зодиака: 
Зарегистрирован: 18.12.2002
Сообщения: 369
Откуда: Из лесу, вестимо
|
|
|
Цитата |
|
Воистину, всё сущее найдёшь в хелпе!
Adding sound to a page
There are several different types of sound files and formats, and several different ways to add sound to a web page. Some factors to consider before deciding on a format and method for adding sound are its purpose, your audience, file size, sound quality, and differences in browsers.
Note: Sound files are handled very differently and inconsistently by different browsers. You may want to add a sound file to a Flash movie, then embed the SWF file to improve consistency.
и т.д.
В результате получаем:
| Код: |
<HTML><HEAD>
<SCRIPT language="JavaScript" type="text/JavaScript"><!--
function MM_controlSound(x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appName == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovie") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileName) method = "run";
} }
if (method) eval(_sndObj+"."+method+"()");
else window.location = sndFile;
}
//--></SCRIPT>
</HEAD>
<BODY>
<INPUT type="button" onClick="MM_controlSound('play','document.SOUNDOBJ','snd.mp3')" value="Play Sound">
<EMBED src='snd.mp3' width=0 height=0 hidden=true autostart=false loop=false name='SOUNDOBJ' mastersound id="SOUNDOBJ"></EMBED>
</BODY>
</HTML> |
_________________ Он умудрялся на бегу прописать дырочку в снегу. (Веня Дркин) |
|
| В начало |
|
 |
|
|
| В начало |
|
 |
 TuXAPuK
Великий гонщик


Возраст: 26
Знак зодиака: 
Зарегистрирован: 12.09.2005
Сообщения: 714
Откуда: Великий город Рига... =Ъ
|
|
|
Цитата |
|
А ещё для IE после 5.5 есть BGSOUND
Из хэлпа по DHTML
| Цитата: |
Description
The BGSOUND tag allows you to create pages with background sounds or "soundtracks."
Syntax:
<BGSOUND
BALANCE=n
CLASS=classname
ID=value
LANG=language
LOOP=n
SRC=url
TITLE=text
VOLUME=n
>
Parameter Description:
BALANCE=n Determines how the available volume will be divided between the left and right speakers. Valid values for this attribute are in the range of -10,000 to +10,000, with 0 being "Wave Output" center balanced.
CLASS=classname Specifies the class of the tag being defined. This is used to associate a sub-classed style sheet with the tag.
ID=value An SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Valid ID values must begin with a letter. The underbar character, "_", may be used in the ID name. The ID should be unique throughout the scope of the document. If more than one object with the same identifier exists in a document, a collection of those named items is created that can only be referenced by ordinal position.
LANG=language Specifies which language to use in ISO standard language abbreviation form.
LOOP=n Specifies how many times a sound will loop when activated.
SRC=url Specifies the URL of a sound to be played.
TITLE=text Used to provide advisory information.
VOLUME=n Determines the loudness of a page's background sound. Valid values for this attribute are in the range of -10,000 to 0, with 0 being full "Wave Output" volume.
Remarks
This element may be used within the HEAD tag.
The start tag is required, and the end tag is optional.
|
А также BGSOUND как Scripting Object
| Цитата: |
Description
Allows you to create pages with background sounds or "sound tracks."
Remarks
This element can be used only within the HEAD tag.
Properties
balance, className, document, id, isTextEdit, loop, offsetHeight,
offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText,
parentElement, parentTextEdit, sourceIndex, src, style, tagName, title,
volume
Methods
contains, getAttribute, removeAttribute, setAttribute
Collections
all, children
|
PS: Так как на моём компе мирно живёт WinCih я не стану выкладывать этот хэлп, а то вдруг его какой небудь лам без антивирусника скачает, и у него тоже появится новый друг на компе... скажу одно... ОООЧЕНЬ СОВЕТУЮ поискать (HTMLREF.CHM + HTMLREF.CHI) и (JSCRIPT5.CHM + JSCRIPT5.CHI) после того как я обзавёлся этими спрвочниками я забыл о всех своих недугах програмирования HTML и JavaScript 8) _________________
 |
|
| В начало |
|
 |
 TuXAPuK
Великий гонщик


Возраст: 26
Знак зодиака: 
Зарегистрирован: 12.09.2005
Сообщения: 714
Откуда: Великий город Рига... =Ъ
|
|
|
Цитата |
|
| TuXAPuK писал(а): | ОООЧЕНЬ СОВЕТУЮ поискать (HTMLREF.CHM + HTMLREF.CHI) и (JSCRIPT5.CHM + JSCRIPT5.CHI) после того как я обзавёлся этими спрвочниками я забыл о всех своих недугах програмирования HTML и JavaScript 8) |
Боже! Храни этот форум вечно! Аминь....
Я думал что больше некогда не найду названия этих справок.... _________________
 |
|
| В начало |
|
 |
 NikotiN
Розовый мамонт

Возраст: 26
Знак зодиака: 
Зарегистрирован: 18.03.2005
Сообщения: 2137
|
|
|
Цитата |
|
в пятой версии html тег audio появился _________________ Сила дурака в том, что умный перед ним бессилен. |
|
| В начало |
|
 |
 dogma
aka Достоевский

Возраст: 27
Знак зодиака: 
Зарегистрирован: 20.12.2004
Сообщения: 1702
Откуда: Холмск
|
|
| В начало |
|
 |
|