Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JavaScript: Mehrere OnMouseOver oder mehrere Angaben in einem OnMouseOver?

Empfohlene Antworten

hi,

wenn ich jetzt ne zelle habe und da folgenden code drin habe:

<td OnMouseOver="this.style.backgroundColor='#DDDDDD';" OnMouseOut="this.style.backgroundColor='#FFFFFF';">

kann ich dann z.b. noch weitere angaben in diesem onmouseover machen oder muss ich dafür ein neues onmouseover erstellen? habs ausprobiert, aber bei mir hats immer nur mit 1 gefuntzt (egal wie ichs probiert hab).

danke

:)

natuerlich kannst du mehrere anweisungen semikolon seperiert in den events unterbringen.

alternativ kannst du dir natuerlich auch ne funktion schreiben, im header einbinden und im event aufrufen

gruss


<script lang="javascript"><!--

function aendern() {

  this.style.backgroundColor='#dddddd';

  this.style. ....

  ...

}

--></script>


... <td onMouseOver="javascript:aendern()" ...>

so würd ich's machen.

hi,

wenn ich jetzt ne zelle habe und da folgenden code drin habe:

<td OnMouseOver="this.style.backgroundColor='#DDDDDD';" OnMouseOut="this.style.backgroundColor='#FFFFFF';">

kann ich dann z.b. noch weitere angaben in diesem onmouseover machen oder muss ich dafür ein neues onmouseover erstellen? habs ausprobiert, aber bei mir hats immer nur mit 1 gefuntzt (egal wie ichs probiert hab).

danke

:)

entweder so:


<script lang="javascript"><!--

function aendern() {

  this.style.backgroundColor='#dddddd';

  this.style. ....

  ...

}

--></script>


... <td onMouseOver="javascript:aendern()" ...>
so würd ich's machen.
oder ich würd es wenns nur 2 "kleine" zuweisungen sind direkt beides im Tag machen:

<td 

OnMouseOver="this.style.backgroundColor='#DDDDDD';this.style.color='#FFFFFF';"

 OnMouseOut="this.style.backgroundColor='#FFFFFF';this.style.color='#000000';"

>

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.