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.

X- und Y-Koordinaten mit JavaScript

Empfohlene Antworten

Hallo "Freunde",

ich stehe gerade "TOTAL" auf dem Schlauch ... folgendes Problem ... ich möchte mittels JavaScript Koordinaten eines Bildes (oder Link ... oder whatever) ermitteln (egal ob absolut oder relativ) ... ich komme da aber nicht ran (ich möchte keine Events reinmachen ... es muss doch irgendwo an dem Objekt die Postition / en dranhängen .... ich konnte sie aber nicht finden) ... kann mir jemand helfen? schon mal danke im Voraus ... So sieht es im Quellcode aus ...


var obj = document.getElementById("test-link");

// wie kann ich jetzt auf die Position im Dokument zugreifen?

// obj.style.? .... top, left ect. liefert immer 0 oder Leerstring

Gruß

Holger

Probier mal das , evtl. hilfts dir :

<body onMousemove="microsoftMouseMove()">

<SCRIPT LANGUAGE="JavaScript">

<!--

if (navigator.appName == 'Netscape') {

document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = netscapeMouseMove;}

function netscapeMouseMove(e) {

if (e.screenX != document.test.x.value && e.screenY != document.test.y.value) {

document.test.x.value = e.screenX;

document.test.y.value = e.screenY; } }

function microsoftMouseMove() {

if (window.event.x != document.test.x.value && window.event.y != document.test.y.value) {

document.test.x.value = window.event.x;

document.test.y.value = window.event.y;

if (window.event.x)

if (window.event.x);}}

//-->

</SCRIPT>

<FORM NAME="test">

X: <INPUT TYPE="TEXT" NAME="x" SIZE="4">

Y: <INPUT TYPUE="TEXT" NAME="y" SIZE="4">

</FORM>

cu mcmaiers

Danke euch schon mal für die Beispiele .... was ich aber suche (vorausgesetzt es ist möglich) ist, dass ich KEINE !!! GLOBALEN EVENTS einsetzen möchte ... es muss doch über DOM oder whatever möglich sein, die Koordinaten für einen Link oder Image herauszubekommen ... oder geht das nicht?

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.