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.

JS Style Prob

Empfohlene Antworten

Veröffentlicht

Hi Leute,

folgender Code:


function checkHighlight( sMode)

{

   // alert( "Mode: " + sMode);

   if ( !tableHighlight )

   {

      tableHighlight = (sMode == "on");

      return;

   }


   elMouse = getElement ( event.srcElement, 'TR');

   if (elMouse == null)

   {

      return;

   }


   var el = document.all.HighlightedRow;

   var el_mini = document.all.HighlightedRow_mini;


   if (el != null)

   {

      el.style.backgroundColor = el.oldcolor;

      if (el_mini != null)

      {

         el_mini.style.backgroundColor = el.style.backgroundColor;

      }

   }


   if ( sMode == "on" || sMode == "scroll" )

   {

      elMouse.style.backgroundColor = '#8CAEAF';

      elMouse.id = "HighlightedRow";

   }

   else

   {

      elMouse.style.backgroundColor = elMouse.oldcolor;

      elMouse.id = "";

   }

   if ( el_mini != null )

   {

      el_mini.style.backgroundColor = elMouse.style.backgroundColor;

   }

}


function getElement ( oParent, sTag)

{

   var el = oParent;

   while (el != null && el.tagName != sTag)

   {

      el = el.parentElement;

   }

   return el;

}


<tr height=0 bgcolor=$bgcolor id='HighlightedRow_mini'>

<td colspan=10><a name='$kuerzel'></td>

</tr>

<tr id='HighlightedRow' oldcolor=$oldcolor bgcolor=$bgcolor  onMouseover='checkHighlight(\"on\")' onMouseout='checkHighlight(\"off\")'\n>

das is mein code.

er dient dazu eine zeile über der ich gerade meine mouse habe in einer anderen bgcolor als die std. zeilen zu markieren!

ich verwende einen anker der in auf der highlitedRow_mini liegt da wenn ich den anker auf die normale highlitedrow machen würde dann der inhalt so angeklebt am frameober rand hängt!

nu habe ich das problem das ab und zu beim mouseover einer TR ein js fehler kommt (style ist null oder kein objekt!) ich konnte noch keine regel,äßigkeit feststellen da manchmal wenn man die seite läd der fehler gar nicht auftritt und manchma schon beim laden aber manchma auch erst nach scrollen und ständigen mouseovern usw.

sieht jemand von euch das prob??

gruss

kills

PS: wenn ihr weitere angaben braucht müsst ihr nur fragen =)

hab noch ne kleinigkeit vergessen!

also die globale variable

tableHighlight = false;

wird noch am anfang gesetzt

gruss

kills

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.