Autor Beitrag
Bela Urlaub
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 453

WinXP Prof/Home, Win98SE (nur auf Server)
D6 Pers
BeitragVerfasst: Mi 22.10.03 11:45 
Hi Leutz,

da ich keine Ahnung von JavaScript hab frag ich mal euch, ob jemand ein Script hat, wo bei einem Mouseover über ein Bild das bild ändert und einen ton wiedergibt. PHP würd auch gehn.

Danke schonmal :)

_________________
mensch, menschen können auch probleme haben...
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Mi 22.10.03 11:57 
PHP würde nicht gehen, da Du damit nichts Clientseitiges machen kannst. Und für den JavaScript-Code sieh mal unter selfHTML nach.

barfuesser
Bela Urlaub Threadstarter
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 453

WinXP Prof/Home, Win98SE (nur auf Server)
D6 Pers
BeitragVerfasst: Mi 22.10.03 15:23 
ok, danke aber ich hab nur eine Hälfte finden können wo ich brauche.
Das mit dem OnMouseOver mit dem Sound hab ich nix bis jetzt finden können... Hat das jemand von euch??

_________________
mensch, menschen können auch probleme haben...
NCortex
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 126

WIN 2000
D7 Enterprise
BeitragVerfasst: Mi 22.10.03 15:53 
hmm... vllt einfach in ein onmouse over event den <embed> tag mit document.write ausgeben? hab ncih viel ahnung mit javascript, habs auch nciht ausprobiert, aber müsste doch möglich sein oder?

_________________
"...by all means, do not use a hammer." (aus einer IBM Technikerdokumentation ca. 1920)
--->außer es kam von Microsoft<---
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Mi 22.10.03 16:26 
Tripod Lycos hat folgendes geschrieben:
Sound, wenn die Maus auf einen Link zeigt

Wie wäre es, wenn der Mouseover-Effekt für Links einen Sound produzieren würde?

Fügen Sie dieses kleine JavaScript-Programm in den Kopf Ihrer Seite ein:

<script LANGUAGE="JavaScript">
<!--
var aySound = new Array();
aySound[0] = "my_sound.wav";

document.write('<BGSOUND id="auIEContainer">')
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.auIEContainer: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>

Alle auf der Seite verwendeten Klänge sind in einer aySound-Tabelle definiert. Wenn Sie weitere Klänge verwenden möchten, fügen Sie eine Zeile wie die folgende hinzu:

aySound[0]="my_sound.wav";

Ersetzen Sie 0 durch die Nummer des Klangs in der Tabelle und my_sound.wav durch die Sounddatei, die Sie integrieren möchten (falls erforderlich mit dem gesamten Dateipfad).

Passen Sie als Nächstes jeden Ihrer Links wie folgt an:

<A HREF="YourPage.html" onMouseOver="playSound(0)" onMouseOut="stopSound(0)">Your link here !</A>

Ersetzen Sie 0 durch die Nummer des Klangs, den Sie einem Link zuweisen möchten.


Nicht getestet!

Stefan

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
NCortex
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 126

WIN 2000
D7 Enterprise
BeitragVerfasst: Mi 22.10.03 16:49 
das ist genau das was ich sagte Stefan *gg*

_________________
"...by all means, do not use a hammer." (aus einer IBM Technikerdokumentation ca. 1920)
--->außer es kam von Microsoft<---
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Mi 22.10.03 16:52 
NCortex hat folgendes geschrieben:
das ist genau das was ich sagte Stefan *gg*


ich habs auch lieber, wenn man mir einen Code Postet.. :lol:

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
Bela Urlaub Threadstarter
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 453

WinXP Prof/Home, Win98SE (nur auf Server)
D6 Pers
BeitragVerfasst: Mi 22.10.03 20:18 
Hmmm... Mit embed hab ich es schon probiert. Da zeigts mir überhaupt nix mehr an :?
Und das andere Prob is dass ich bereits onMouseOver schon drin hab.
Ich habs eben schon mit einem kürzeren Script wo ich doch nóch wo gefunden hab, versucht. Ohne Erfolg. Gehn überhaupt 2 mouseover's auf eine sache/ in einem <a ....> ???

_________________
mensch, menschen können auch probleme haben...
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Do 23.10.03 07:58 
Natürlich geht das. Du übergibst dem img-Tag im onMouseover-Attribute eine JavaScript-Funktion, in der Du beide Tätigkeiten ausführst.
ausblenden Quelltext
1:
<img src="ImgSrc0" onMouseover="markImg(0)" onMouseOut="unmarkImg(0)" />					

und im JavaScript:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
function markImg (nr) {
  playSound(nr);
  showNewPic(nr);
}

function unmarkImg(nr) {
  stopSound(nr);
  showOldPic(nr);
}


Den Code für die 4 Funktionen dürftest Du ja mittlerweile haben.

barfuesser
Bela Urlaub Threadstarter
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 453

WinXP Prof/Home, Win98SE (nur auf Server)
D6 Pers
BeitragVerfasst: Do 23.10.03 15:34 
ok danke, jetzt geht alles :)
Nur eins stört mich jetzt noch.
Auf jeder Seite ist jetzt ganz unten so ein kleines, viereckiges Teil, wo normalerweise ein Bild dagstellt wird. Das ist aber erst durch das HIER erste script gekommen. ich lad das mal hoch, könnts euch ja anschaun... www.belaurlaub.net/neu/

_________________
mensch, menschen können auch probleme haben...
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Do 23.10.03 15:41 
komisch, ich seh kein Viereck :D

barfuesser
Bela Urlaub Threadstarter
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 453

WinXP Prof/Home, Win98SE (nur auf Server)
D6 Pers
BeitragVerfasst: Do 23.10.03 15:43 
ganz unten Links

_________________
mensch, menschen können auch probleme haben...
Ja-Pa
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 458

Win XP, Suse 9.3
D1, D3, D5 Std, D7 Pro, D2005 Pers, Kylix 3
BeitragVerfasst: Do 23.10.03 15:44 
Kleines viereckiges Teil? :?:
Also ich seh´ da nichts (im InternetExplorer).
Falls du ganz unten rechts diesen blauumrandeten kleinen Katen mit einem kleinen grauen Pfeil nach unten meinst, das ist die Scrollbar :wink:
Die Darstellung wurde auf deiner Seite durch ein CSS-Script (<style...>)
geändert.

Gruß, Ja-Pa

_________________
Der Autor dieses Textes haftet nicht für Schäden an Soft- oder Hardware
oder Vermögensschäden, die durch das Benutzen des Textes entstehen.
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 23.10.03 15:44 
Hallo,

dies liegt an der Zeile
ausblenden Quelltext
1:
document.body.insertAdjacentHTML("BeforeEnd",Str);					


in function auPreload().

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Bela Urlaub Threadstarter
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 453

WinXP Prof/Home, Win98SE (nur auf Server)
D6 Pers
BeitragVerfasst: Do 23.10.03 15:48 
@ Pa-Ja, willst du mich hier dumm darstellen???
Klar weiss ich dass rechts der Scrollbalken is und dass ich css verwendet hab :) Ich benutz auch den IE :)

@ smiegel und wie änder ich das??? Hab immerhin keine Ahnung von JavaScript :lol:

_________________
mensch, menschen können auch probleme haben...
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 23.10.03 15:49 
Hallo,

entweder die Zeile löschen oder in /* .... */ setzen.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Do 23.10.03 15:52 
Also ich hab mir das noch mal mit verschiedenen Browsern angesehen:
    MSIE 6.0: kein Viereck
    Mozilla 1.3.1: kein Viereck
    Opera 7.11: kein Viereck
    Amaya 8.1b: kein Viereck
barfuesser
Bela Urlaub Threadstarter
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 453

WinXP Prof/Home, Win98SE (nur auf Server)
D6 Pers
BeitragVerfasst: Do 23.10.03 15:54 
Wenn ich das in /* ...*/ setz dann kommt kein Ton mehr
Ich mach mal nen Screeny dann seht ihr wos bei mir is

_________________
mensch, menschen können auch probleme haben...
Ja-Pa
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 458

Win XP, Suse 9.3
D1, D3, D5 Std, D7 Pro, D2005 Pers, Kylix 3
BeitragVerfasst: Do 23.10.03 16:03 
Bela Urlaub hat folgendes geschrieben:
@ Pa-Ja, willst du mich hier dumm darstellen???
Klar weiss ich dass rechts der Scrollbalken is und dass ich css verwendet hab :) Ich benutz auch den IE :)


Ich wolltes ja nur ma sagen :wink: .
Die Cousine eines Freundes von mir arbeitet in einer Firma, die Anwendern von verschiedenen Programmen Support gibt.
Die hatten mal einen Fall, da wollte der Anwender speichern (oder so), hat es aber nicht hingekriegt. Die haben dann versucht, duch alle möglichen Tricks da was zu machen, aber es ging nicht, bis endlich jemand zu dem nach Hause gekommen ist.
Der Anwender hat das Kabel der Maus unter dem Tisch durchgelegt, sodass das Kabel zu ihm zeigte und hat dann immer die falsche Maustaste gedrückt.
Also erst immer das einfachste ausprobieren :wink: :wink: :wink:
Nicht böse sein bitte... :oops: :P

Übrigens heiß ich Ja-Pa nicht Pa-Ja. Das hört sich ja an wie Papaja :wink:

Gruß, Ja-Pa

_________________
Der Autor dieses Textes haftet nicht für Schäden an Soft- oder Hardware
oder Vermögensschäden, die durch das Benutzen des Textes entstehen.
Bela Urlaub Threadstarter
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 453

WinXP Prof/Home, Win98SE (nur auf Server)
D6 Pers
BeitragVerfasst: Do 23.10.03 16:05 
Oh sorry :mrgreen:

hier n kleiner Screeny:
user defined image

_________________
mensch, menschen können auch probleme haben...