Current location - Music Encyclopedia - QQ Music - How can I make the background music of a web page play continuously even when changing pages?
How can I make the background music of a web page play continuously even when changing pages?

Play music

In addition to inserting graphics, HTML can also play music and videos. The music formats that can be played with the browser include: MIDI music, WAV music, and AU format. In addition, among the various music formats downloaded from the Internet, MP3 is the file format with the highest compression rate and the best sound quality.

Background music

Background music is the music you hear when you open a web page.

lt; bgsound src="Music file address" loop=#gt;

#=number of loops, -1 means infinite loop.

Example:

lt;bgsound src="sound.wav" loop=3gt;

The above is the web background music code that everyone wantslt;bgsound Src=music address loop=number of playsgt;

--------------------------------------------- ------------------------------------

Music on demand

Make music into a link, just click on it with the mouse, and you can listen to the moving music. The method of doing this is very simple:

lt; A HREF="Music Address" gt;Song namelt;/Agt;

For example: play a piece of MIDI music:

lt;A HREF="midi.mid"gt;MIDI musiclt;/Agt;

Play a piece of AU format music:

lt; A HREF="you.au"gt; You at the same table - AU music lt; /Agt;

Collect the music we like and make it into a music library. We can let ourselves and others wander in the ocean of music at any time. Some people have already done this. You must have encountered a lot of it, and you can try it yourself!

--------------------------------------------- -------------------------------------

Automatically load music

p>

Previously, we used links to implement the function of playing music online. We can also let the music load automatically. You can have it appear in the control panel or use it as background music. Basic syntax:

lt;EMBED SRC="Music file address"gt;

Attributes are:

SRC="FILENAME" Set the path of the music file

AUTOSTART=TRUE/FALSE Whether you want the music file to be played automatically after being transferred, TRUE means yes, FALSE means no, the default is FALSE

LOOP=TRUE/FALSE Set the number of playback repetitions , LOOP=6 means repeating 6 times, TRUE means playing unlimited times, FALSE means playing once and stopping.

STARTIME="Minutes:Seconds" Set the start playback time of the music. For example, if it plays after 20 seconds, write it as STARTIME=00:20

VOLUME=0-100 Set the volume size. If not set, the system volume will be used.

WIDTH HEIGHT Set the size of the control panel

HIDDEN=TRUE Hide the control panel

CONTROLS=CONSOLE/SMALLCONSOLE Set the appearance of the control panel

Example:

******************************************

lt;htmlgt;

lt;headgt;

lt;titlegt;Play musiclt;/titlegt;

lt;/headgt ;

lt;bodygt;

lt;EMBED SRC="midi.mid" autostart=true hidden=true loop=truegt;

as background music Play.

lt;/bodygt;

lt;/htmlgt;

Example:

************ ***************************

lt;htmlgt;

lt;headgt;

lt; titlegt; play musiclt; /titlegt;

lt; /headgt;

lt; bodygt;

lt; EMBED SRC="midi.mid" loop=true width=145 height=60gt;

lt;Pgt; The control panel appears, you can control it on and off, and also adjust the volume. lt;/Pgt;

lt;/bodygt;

lt;/htmlgt;

Realize partial refresh of web pages

Server The postback will trigger the refresh of the entire page. How can I only let it refresh part of it? I saw a book about using

WebService behavior a few days ago. I tried it today and the effect was pretty good

You need a file webservice.htc in the web directory

You can download it here: /workshop/author/webservice/webservice.htc

See a WebService file named Service1 .asmx:

[Basic types of WebService(Namespace=" and their arrays

For example: dataset, datatable complex types are not supported