Autor Beitrag
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 21.12.05 16:16 
Hallo,

ich möchte dass sich eine bestimmte Grafik ändert (also ein anderes bild "insich" lädt) wenn man mit dem Mauszeiger darüber fährt. Sobald man mim Mauszeiger das Bild verlässt soll es sich wieder in den Urzustand zurückverwandeln. Ich hab keine Ahnung wie ich das angehe und bei SelHTML habe ich nichts gefunden.


mfg
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 16:21 
Ich habs mal gekonnt, aber das is schon laaaaange her.
Ich glaube ich hab das damals mit javascript gemacht. Aber wissen tu ichs nicht mehr...
Als ich mit PHP angefangen hab, habe ich JavaScript aus meinem Hirn verbannt ;-)

Kannsts ja mal versuchen (mit JavaScript).
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 21.12.05 16:24 
ja du bist gut, ich kann kein javascript, ich hab versucht mir das von ner anderen Seite zu "klauen", da gabs ne mm.js und diverse Codeteile die ich kopierte, das hat aber ned gefunzt.
Bin um jede Hilfe dankbar!
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 16:30 
so was zu mopsen bringt nix und verstösst unter umständen gegn urheberrechte!
Also: Oh weh! Papa schimpft! ;-) *lol*

In dem Buch

Webdesign

von

Markt&Technik


steht leicht verständlich erklärt, wie javascript funzt und wie man dein OnMouseOverProblem lösen kann.

Ich hab mein Buch leider verlegt und kanns nicht mehr finden...
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 21.12.05 16:32 
Tja, das hilft mir auch nicht weiter, vlt gibbet es ja jemanden der's weis.

Quelltext anzeigen und zu kopieren is ja wohl noch erlaubt oder?
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mi 21.12.05 16:38 
Kommt drauf an, ob der Autor es erlaubt :-)
DarkHunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Mi 21.12.05 16:39 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta name="generator" content="Webweaver v1.6.7 [http://webweaver.ws]" />
<script type="text/javascript" language="javascript">
function swap (imgname,image)
{
 if (document.images)
 {
    document[imgname].src = image;
 }
}

</script>
</head>
<body>
<map name="karte">
<area shape="poly" coords="1,1,50,1,50,40,40,50,1,50,1,1" href="" onMouseout="swap('bild','leer.png')" onMouseover="swap('bild','rot.png')"/>
<area shape="poly" coords="50,1,100,1,100,50,60,50,50,40,50,1" href="" onMouseout="swap('bild','leer.png')" onMouseover="swap('bild','blau.png')"/>
<area shape="poly" coords="1,50,40,50,50,60,50,100,1,100,1,50" href="" onMouseout="swap('bild','leer.png')" onMouseover="swap('bild','gelb.png')"/>
<area shape="poly" coords="100,100,50,100,50,60,60,50,100,50,100,100" href="" onMouseout="swap('bild','leer.png')" onMouseover="swap('bild','gruen.png')"/>
<area shape="circle" coords="50,50,10" href="" onMouseout="swap('bild','leer.png')" onMouseover="swap('bild','grau.png')"/>
</map>
<img src="leer.PNG" alt="leer" border="0" height="100" width="100" name="bild" usemap="#karte"/>

</body>
</html>

Diese Code habe ich mir mal erarbeitet um zu testen wie Image-Maps funktionieren und wie man den besangten OnMouseOverEffekt erzeugen kann.

Ist nur sehr wenig Code wie man sieht.
Zur Funktionsweise: Es wird nur das src Attribute eines <img> angepasst, wenn da ein entsprechend großes Bild drinne ist, so muss das erst noch geladen werden, der Image-preload fehlt also komplett :D

_________________
I believe that every human has a finite number of heart-beats. I don't intend to waste any of mine running around doing exercises.
- Neil Armstrong
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 21.12.05 16:55 
Danke! Geht Eins-A!