如何实现onclick <img src="pic1.jpg" onclick="this.src='pic2.jpg'"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 修正一点,java与javascript是不一样的java是面对对象的。而javascript只是基于对象<img src="you.gif" onclick="this.src=you1.gif"> 太感谢了但是图片可以实现,换到背景音乐就不行了?为什么啊??<bgsound src="1.mp3" onclick="this.src='2.mp3'" loop="-1"> <bgsound id=snd src="music1.mid" loop=-1 volume=0><a href="javascript:snd.src='music1.mid'">第1首歌</a><a href="javascript:snd.src='music2.mid'">第2首歌</a><a href="javascript:snd.src=''">停止</a><a href="javascript:snd.volume=-100000">静音</a> <bgsound id=snd src="music1.mid" loop=-1 volume=0><a href="javascript:snd.src='music1.mid'">第1首歌</a><a href="javascript:snd.src='music2.mid'">第2首歌</a><a href="javascript:snd.src=''">停止</a><a href="javascript:snd.volume=-100000">静音</a>点第1首歌时出现music1.mid然后音乐就停了,也没有换。(是不是这个代码不全啊) 你可以控制每一个东西:如果你的网络速度快,这是个很好的例子,在线播放!!!!!!!!!!MP3音质!!:<body bgproperties="fixed" bgcolor="#000000"><OBJECT classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,05,0809 height=256 id=NSOPlay type=application/x-oleobject width=245 standby="Connecting with Live Event. Please wait patiently..."> <PARAM NAME="AudioStream" VALUE="-1"> <PARAM NAME="AutoSize" VALUE="-1"> <PARAM NAME="AutoStart" VALUE="-1"> <PARAM NAME="AnimationAtStart" VALUE="-1"> <PARAM NAME="AllowScan" VALUE="-1"> <PARAM NAME="AllowChangeDisplaySize" VALUE="-1"> <PARAM NAME="AutoRewind" VALUE="-1"> <PARAM NAME="Balance" VALUE="-1"> <PARAM NAME="BaseURL" VALUE=""> <PARAM NAME="BufferingTime" VALUE="5"> <PARAM NAME="CaptioningID" VALUE="-1"> <PARAM NAME="ClickToPlay" VALUE="-1"> <PARAM NAME="CursorType" VALUE="-1"> <PARAM NAME="CurrentPosition" VALUE="-1"> <PARAM NAME="CurrentMarker" VALUE="-1"> <PARAM NAME="DefaultFrame" VALUE="content"> <PARAM NAME="DisplayBackColor" VALUE="0"> <PARAM NAME="DisplayForeColor" VALUE="16777215"> <PARAM NAME="DisplayMode" VALUE="0"> <PARAM NAME="DisplaySize" VALUE="4"> <PARAM NAME="Enabled" VALUE="-1"> <PARAM NAME="EnableContextMenu" VALUE="-1"> <PARAM NAME="EnablePositionControls" VALUE="-1"> <PARAM NAME="EnableFullScreenControls" VALUE="-1"> <PARAM NAME="EnableTracker" VALUE="-1"> <PARAM NAME="Filename" VALUE="http://go6.163.com/colorweb/play.asx"> <PARAM NAME="InvokeURLs" VALUE="-1"> <PARAM NAME="Language" VALUE="-1"> <PARAM NAME="Mute" VALUE="0"> <PARAM NAME="PlayCount" VALUE="-1"> <PARAM NAME="PreviewMode" VALUE="0"> <PARAM NAME="Rate" VALUE="1"> <PARAM NAME="SAMILang" VALUE=""> <PARAM NAME="SAMIStyle" VALUE=""> <PARAM NAME="SAMIFileName" VALUE=""> <PARAM NAME="SelectionStart" VALUE="-1"> <PARAM NAME="SelectionEnd" VALUE="-1"> <PARAM NAME="SendOpenStateChangeEvents" VALUE="-1"> <PARAM NAME="SendWarningEvents" VALUE="-1"> <PARAM NAME="SendErrorEvents" VALUE="-1"> <PARAM NAME="SendKeyboardEvents" VALUE="0"> <PARAM NAME="SendMouseClickEvents" VALUE="-1"> <PARAM NAME="SendMouseMoveEvents" VALUE="-1"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="-1"> <PARAM NAME="ShowCaptioning" VALUE="0"> <PARAM NAME="ShowControls" VALUE="-1"> <PARAM NAME="ShowAudioControls" VALUE="-1"> <PARAM NAME="ShowDisplay" VALUE="-1"> <PARAM NAME="ShowGotoBar" VALUE="0"> <PARAM NAME="ShowPositionControls" VALUE="-1"> <PARAM NAME="ShowStatusBar" VALUE="-1"> <PARAM NAME="ShowTracker" VALUE="-1"> <PARAM NAME="TransparentAtStart" VALUE="-1"> <PARAM NAME="VideoBorderWidth" VALUE="0"> <PARAM NAME="VideoBorderColor" VALUE="0"> <PARAM NAME="VideoBorder3D" VALUE="0"> <PARAM NAME="Volume" VALUE="-450"> <PARAM NAME="WindowlessVideo" VALUE="0"> <EMBED type="video/x-ms-asf-plugin" pluginspage="http://www.microsoft.com/goto/mscom/windows/mediaplayer/default.asp" filename="http://colorweb.go.163.com/play.asx" name="NSOPlay" width="286" height="172" DefaultFrame="content" AnimationAtStart="-1" AutoRewind="-1" AutoStart="-1" Autosize="-1" ControlType="-1" DisplaySize="6" ShowAudioControls="-1" ShowControls="-1" ShowDisplay="-1" ShowGotoBar="-1" ShowPositionControls="-1" ShowStatusBar="-1" ShowTracker="-1" TransparentAtStart="-1"> </EMBED> </OBJECT><br><input onclick="document.all.NSOPlay.pause()" type=button value="停止"><input onclick="document.all.NSOPlay.play()" type=button value="播放"><input onclick="document.all.NSOPlay.ShowStatusBar='0'" type=button value="没有状态栏"><input onclick="document.all.NSOPlay.Volume='-1000'" type=button value="减小声音"><input onclick="document.all.NSOPlay.Volume='0'" type=button value="增大声音"><input onclick="document.all.NSOPlay.Stop();document.all.NSOPlay.CurrentPosition=0;document.all.NSOPlay.play()" type=button value="回放"><input onclick="document.all.NSOPlay.Previous()" type=button value="上一首"><input onclick="document.all.NSOPlay.Next()" type=button value="下一首"><input onclick="document.all.NSOPlay.FastForward()" type=button value="快进"></body> 是不是先给出一个列表,点连接后<PARAM NAME="Filename" VALUE="1.mp3">播放第一首点下一首时改成<PARAM NAME="Filename" VALUE="2.mp3">对吧。 关于<tr>里嵌套<table>的问题 判断html对象 能给几个用CSS改变select控件外观的例子吗? js中怎么实现vbs中的Asc功能? 在JS中这样的语句是什么时候付值的? 关于刷新的小问题 我在页面传递参数时,中文变成乱码?为什么?? 大家看一下~~~ 求一个具有一定数据处理功能的 JS TABLE 插件 请教Bootstrap下拉菜单更改为悬停(hover)触发后,电脑端正常,移动端失效。 请问下拉菜单中选项的文本内容如何获得? 谁能推荐一本javascript的权威变成书?
java是面对对象的。而javascript只是基于对象
<img src="you.gif" onclick="this.src=you1.gif">
但是图片可以实现,换到背景音乐就不行了?为什么啊??
<bgsound src="1.mp3" onclick="this.src='2.mp3'" loop="-1">
<a href="javascript:snd.src='music1.mid'">第1首歌</a>
<a href="javascript:snd.src='music2.mid'">第2首歌</a>
<a href="javascript:snd.src=''">停止</a>
<a href="javascript:snd.volume=-100000">静音</a>
<a href="javascript:snd.src='music1.mid'">第1首歌</a>
<a href="javascript:snd.src='music2.mid'">第2首歌</a>
<a href="javascript:snd.src=''">停止</a>
<a href="javascript:snd.volume=-100000">静音</a>
点第1首歌时出现music1.mid
然后音乐就停了,也没有换。
(是不是这个代码不全啊)
<body bgproperties="fixed" bgcolor="#000000">
<OBJECT classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,05,0809 height=256 id=NSOPlay type=application/x-oleobject width=245 standby="Connecting with Live Event. Please wait patiently...">
<PARAM NAME="AudioStream" VALUE="-1">
<PARAM NAME="AutoSize" VALUE="-1">
<PARAM NAME="AutoStart" VALUE="-1">
<PARAM NAME="AnimationAtStart" VALUE="-1">
<PARAM NAME="AllowScan" VALUE="-1">
<PARAM NAME="AllowChangeDisplaySize" VALUE="-1">
<PARAM NAME="AutoRewind" VALUE="-1">
<PARAM NAME="Balance" VALUE="-1">
<PARAM NAME="BaseURL" VALUE="">
<PARAM NAME="BufferingTime" VALUE="5">
<PARAM NAME="CaptioningID" VALUE="-1">
<PARAM NAME="ClickToPlay" VALUE="-1">
<PARAM NAME="CursorType" VALUE="-1">
<PARAM NAME="CurrentPosition" VALUE="-1">
<PARAM NAME="CurrentMarker" VALUE="-1">
<PARAM NAME="DefaultFrame" VALUE="content">
<PARAM NAME="DisplayBackColor" VALUE="0">
<PARAM NAME="DisplayForeColor" VALUE="16777215">
<PARAM NAME="DisplayMode" VALUE="0">
<PARAM NAME="DisplaySize" VALUE="4">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="EnableContextMenu" VALUE="-1">
<PARAM NAME="EnablePositionControls" VALUE="-1">
<PARAM NAME="EnableFullScreenControls" VALUE="-1">
<PARAM NAME="EnableTracker" VALUE="-1">
<PARAM NAME="Filename" VALUE="http://go6.163.com/colorweb/play.asx">
<PARAM NAME="InvokeURLs" VALUE="-1">
<PARAM NAME="Language" VALUE="-1">
<PARAM NAME="Mute" VALUE="0">
<PARAM NAME="PlayCount" VALUE="-1">
<PARAM NAME="PreviewMode" VALUE="0">
<PARAM NAME="Rate" VALUE="1">
<PARAM NAME="SAMILang" VALUE="">
<PARAM NAME="SAMIStyle" VALUE="">
<PARAM NAME="SAMIFileName" VALUE="">
<PARAM NAME="SelectionStart" VALUE="-1">
<PARAM NAME="SelectionEnd" VALUE="-1">
<PARAM NAME="SendOpenStateChangeEvents" VALUE="-1">
<PARAM NAME="SendWarningEvents" VALUE="-1">
<PARAM NAME="SendErrorEvents" VALUE="-1">
<PARAM NAME="SendKeyboardEvents" VALUE="0">
<PARAM NAME="SendMouseClickEvents" VALUE="-1">
<PARAM NAME="SendMouseMoveEvents" VALUE="-1">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="-1">
<PARAM NAME="ShowCaptioning" VALUE="0">
<PARAM NAME="ShowControls" VALUE="-1">
<PARAM NAME="ShowAudioControls" VALUE="-1">
<PARAM NAME="ShowDisplay" VALUE="-1">
<PARAM NAME="ShowGotoBar" VALUE="0">
<PARAM NAME="ShowPositionControls" VALUE="-1">
<PARAM NAME="ShowStatusBar" VALUE="-1">
<PARAM NAME="ShowTracker" VALUE="-1">
<PARAM NAME="TransparentAtStart" VALUE="-1">
<PARAM NAME="VideoBorderWidth" VALUE="0">
<PARAM NAME="VideoBorderColor" VALUE="0">
<PARAM NAME="VideoBorder3D" VALUE="0">
<PARAM NAME="Volume" VALUE="-450">
<PARAM NAME="WindowlessVideo" VALUE="0">
<EMBED type="video/x-ms-asf-plugin" pluginspage="http://www.microsoft.com/goto/mscom/windows/mediaplayer/default.asp" filename="http://colorweb.go.163.com/play.asx"
name="NSOPlay"
width="286"
height="172"
DefaultFrame="content"
AnimationAtStart="-1"
AutoRewind="-1"
AutoStart="-1"
Autosize="-1"
ControlType="-1"
DisplaySize="6"
ShowAudioControls="-1"
ShowControls="-1"
ShowDisplay="-1"
ShowGotoBar="-1"
ShowPositionControls="-1"
ShowStatusBar="-1"
ShowTracker="-1"
TransparentAtStart="-1">
</EMBED>
</OBJECT>
<br>
<input onclick="document.all.NSOPlay.pause()" type=button value="停止">
<input onclick="document.all.NSOPlay.play()" type=button value="播放">
<input onclick="document.all.NSOPlay.ShowStatusBar='0'" type=button value="没有状态栏">
<input onclick="document.all.NSOPlay.Volume='-1000'" type=button value="减小声音">
<input onclick="document.all.NSOPlay.Volume='0'" type=button value="增大声音">
<input onclick="document.all.NSOPlay.Stop();document.all.NSOPlay.CurrentPosition=0;document.all.NSOPlay.play()" type=button value="回放">
<input onclick="document.all.NSOPlay.Previous()" type=button value="上一首">
<input onclick="document.all.NSOPlay.Next()" type=button value="下一首">
<input onclick="document.all.NSOPlay.FastForward()" type=button value="快进">
</body>
<PARAM NAME="Filename" VALUE="1.mp3">播放第一首
点下一首时改成
<PARAM NAME="Filename" VALUE="2.mp3">
对吧。