bild tauschen mit DHTML effekt

  • #1
A

arNdt1979

Bekanntes Mitglied
Themenersteller
Dabei seit
08.02.2005
Beiträge
81
Reaktionspunkte
0
hallo zusammen,

habe ein kleines problemchen!

und zwar möchte ich, das sich beim mouseover ein
bild andert, klappt (bei frontpage) mit dem DHTML effekt
auch ohne probleme!

...nur hätte ich gerne auch noch einen akustischen effekt
der beim mouseover erklingt.

geht sowas bzw kann man da manuell noch was ergänzen?

das hier müßte der passende code sein!

kann mir da jemand von euch helfen?

Code:
<head>
<meta http-equiv=Content-Type content=text/html; charset=windows-1252>
<title>Neue Seite 1</title>
<script language=JavaScript fptype=dynamicanimation>
<!--
function dynAnimation() {}
function clickSwapImg() {}
//-->
</script>
<script language=JavaScript1.2 fptype=dynamicanimation src=file:///C:/Programme/Microsoft%20Office/OFFICE11/fpclass/animate.js>
</script>
</head>

<body onload=dynAnimation() language=Javascript1.2>

<p>
<a onmouseover=var img=document['fpAnimswapImgFP1'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src; onmouseout=document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].imgRolln href=javascript:void(0)>
<img border=0 src=file:///D:/Homepages/kckt/grafix/8king.jpg width=533 height=247 id=fpAnimswapImgFP1 name=fpAnimswapImgFP1 dynamicanimation=fpAnimswapImgFP1 lowsrc=file:///D:/Homepages/kckt/grafix/111.jpg></a></p>

</body>
 
  • #2
oh,

sollte das doch etwas schieriger sein? ???


mousover soll bildtauschen und gleichzeitig eine
kurze mp3 abspielen...sobald ich die maus wieder
wegbewege das ganze wieder zurück.
 
  • #3
Hallo,
Google-Suche nach mouseover play sound findet viele Links, aber es scheint sich immer um das selbe Skript zu handeln, das leider mit Mozilla nicht funktioniert :(
http://www.dynamicdrive.com/forums/archive/index.php/t-1292.html
In deinem Fall musst Du
Code:
<a onmouseover=var img=document['fpAnimswapImgFP1'];img.imgRolln= (usw.)
so erweitern:
Code:
<a onMouseOut=stopSound(0) onmouseover=playSound(0);var img=document['fpAnimswapImgFP1'];img.imgRolln= (usw.)
Viel Glück und viele Grüße - Ulrich
 
  • #4
besten dank,

allerdings stellt sich mir da noch die frage
wo ich den pfad zur mp3-datei angeben muß!?

...ist nicht so mein spezial gebiet! ;) ::)
 
  • #5
In dem Javascript, was Du in der Head-Sektion einfügen sollst, und zwar hier:
Code:
// PLACE YOUR SOUND FILES BELOW
aySound[0] = CHORD.wav;
Darauf hatte ich bisher allerdings noch nicht geachtet: In dem Script werden wav-Dateien verwendet. Da kannst Du nur hoffen, dass es auch mit mp3 geht!
Ich würde es erst Mal mit einer wav-Datei testen, um sicher zu gehen, dass das Script auch funktioniert.
Viele Grüße - Ulrich
 
  • #6
so erst schon mal besten dank!

teilweise läuft es (mit .wav).

es erklingt der ton, gleichzeitig wechselt das bild,
nur das zurück funxt nicht.

also wenn ich die maus wieder wegbewege, sollte
ja das erste bild wieder erscheinen und das tut es nicht. :'( :-X

Code:
<html>

<head>
<meta http-equiv=Content-Type content=text/html; charset=windows-1252>
<meta name=GENERATOR content=Microsoft FrontPage 4.0>
<meta name=ProgId content=FrontPage.Editor.Document>
<title>Neue Seite 1</title>
<!-- --><bgsound id=soundfiles> 
<script language=JavaScript fptype=dynamicanimation>
<!--
function dynAnimation() {}
function clickSwapImg() {}
//-->
</script>
<script language=JavaScript1.2 fptype=dynamicanimation src=file:///C:/Programme/Microsoft%20Office/Office/fpclass/animate.js>
</script>
</head>

<body onload=dynAnimation()>
<script language=JavaScript><!--
// Sound on Mouseover javascript supplied by [url]http://www.hypergurl.com[/url]

var aySound = new Array();
// PLACE YOUR SOUND FILES BELOW
aySound[0] = blip.wav;
aySound[1] = blip.wav;
aySound[2] = blip.wav;
// Don't alter anything below this line

IE = (navigator.appVersion.indexOf(MSIE)!=-1 && document.all)? 1:0;
NS = (navigator.appName==Netscape && navigator.plugins[LiveAudio])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = <DIV ID='auEmb' STYLE='position:absolute;'></DIV>;
document.body.insertAdjacentHTML(BeforeEnd,Str);
}
var Str =->';
for (i=0;i<aySound.length;i++)
Str += <EMBED SRC='+aySound[i]+' AUTOSTART='FALSE' HIDDEN='TRUE'>
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.soundfiles:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval(this.document.embeds[whSound]. + (play? play():stop()))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//--></script>
<!-- --> 

<p><a onMouseOut=stopSound(0) onmouseover=playSound(0);var img=document['fpAnimswapImgFP1'];img.imgRolln=document['fpAnimswapImgFP1'].src;document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].lowsrc; onmouseout=document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].imgRolln href=javascript:void(0)><img border=0 src=IMG_0744.JPG id=fpAnimswapImgFP1 name=fpAnimswapImgFP1 dynamicanimation=fpAnimswapImgFP1 lowsrc=IMG_0747.JPG width=448 height=336></a></p>

</body>

</html>
 
  • #7
Ups, das hatte ich nicht gesehen, dass da schon ein Mouseout-Eventhandler ist. Dann muss es so richtig lauten:
Code:
<p><a onmouseover=playSound(0);var img=document['fpAnimswapImgFP1'];img.imgRolln=document['fpAnimswapImgFP1'].src;document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].lowsrc; onmouseout=stopSound(0);document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].imgRolln href=javascript:void(0)><img border=0 src=IMG_0744.JPG id=fpAnimswapImgFP1 name=fpAnimswapImgFP1 dynamicanimation=fpAnimswapImgFP1 lowsrc=IMG_0747.JPG width=448 height=336></a></p>
Viele Grüße - Ulrich
 
  • #8
klappt wunderbar,

noch mal besten dank!!!
 
Thema:

bild tauschen mit DHTML effekt

ANGEBOTE & SPONSOREN

Statistik des Forums

Themen
113.838
Beiträge
707.961
Mitglieder
51.491
Neuestes Mitglied
haraldmuc
Oben