🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.javascript
5 messages
5 total messages Started by Dicky Moe Mon, 05 Oct 2009 16:55
Niepotrzebnie odpalany onmouseout <-> onmousover
#49422
Author: Dicky Moe
Date: Mon, 05 Oct 2009 16:55
25 lines
1491 bytes
Witam

Tak więc mam na stronie element:

<a href="..." onmouseover="mover(this);" onmouseout="mout(this);">
  <div class="menu_pic" id="elem2">
  ...
  </div>
  <div class="menu_title" id="t_title2">
  ...
  </div>
</a>

"Wizualnie" jest to jeden element, link. Po najechaniu myszką zmieniają sie
obrazki(w obydwu diva-ch, inne) - zresztą to nieważne. Jak widać, link składa
się z dwóch div-ów. I teraz jest problem: gdy przechodzę myszką z jednego
div-a na drugi (w obrębie jednego "a") wywoływane jest: onmouseout i od razu
onmouseover - co nie jest pożądane. Co robię źle? Jak to prawdłowo rozwiązać ?

Pozdrawiam

Dicky Moe

-- 
Wysłano z serwisu Usenet w portalu Gazeta.pl -> http://www.gazeta.pl/usenet/
Re: Niepotrzebnie odpalany onmouseout <-> onmousover
#49423
Author: Tomek Kańka
Date: Mon, 05 Oct 2009 17:42
21 lines
1305 bytes
Dicky Moe <dicky_moe1@NOSPAM.gazeta.pl> napisał(a)
> Witam
>
> Tak więc mam na stronie element:
>
><a href="..." onmouseover="mover(this);" onmouseout="mout(this);">
>  <div class="menu_pic" id="elem2">
>   ...
>  </div>
>  <div class="menu_title" id="t_title2">
>   ...
>  </div>
></a>
>
>[...]

Prawie wcale się na tym nie znam, ale czy można używac <DIV> wewnątrz
<A>? Co na to W3C Validator?

-- 
Tomek
Re: Niepotrzebnie odpalany onmouseout <-> onmousover
#49424
Author: Dicky Moe
Date: Mon, 05 Oct 2009 18:26
13 lines
1176 bytes
Witam

Rzeczywiście, nie można w "a" użyć div-a. Validator wyrzuca:
"document type does not allow element "DIV" here; missing one of
"APPLET","OBJECT", "MAP", "IFRAME", "BUTTON" start-tag".
No to teraz mam trochę większy problem :-(

Pozdrawiam

Dicky Moe

-- 
Wysłano z serwisu Usenet w portalu Gazeta.pl -> http://www.gazeta.pl/usenet/
Re: Niepotrzebnie odpalany onmouseout <-> onmousover
#49425
Author: Tomek Kańka
Date: Mon, 05 Oct 2009 18:52
14 lines
1357 bytes
Dicky Moe <dicky_moe1.SKASUJ@gazeta.pl> napisał(a)
> Witam
>
> Rzeczywiście, nie można w "a" użyć div-a. Validator wyrzuca:
> "document type does not allow element "DIV" here; missing one of
> "APPLET","OBJECT", "MAP", "IFRAME", "BUTTON" start-tag".
> No to teraz mam trochę większy problem :-(
>

Ale po co Ci w ogóle ten <A>? Użyj <DIV> z jakimś onMouseUp, czy jak się
tam nazywa.

-- 
Tomek
Re: Niepotrzebnie odpalany onmouseout <-> onmousover
#49426
Author: Dicky Moe
Date: Mon, 05 Oct 2009 18:56
23 lines
1346 bytes
Witam

Ok, rozwiązałem to mniej więcej tak:

<div style="position:relative">
  <a href="#" onmouseover="mover(this);" onmouseout="mout(this);">
  <img src="img/empty.gif"
style="text-decoration:none;position:absolute;z-index:10;width:144px;height:117px;"/>
  </a>
  <div class="menu_pic"  id="elem2">
      ...
  </div>
  <div class="menu_title" id="t_title2">...</div>
</div>

Działa doskonale.

Pozdrawiam

Dicky Moe

-- 
Wysłano z serwisu Usenet w portalu Gazeta.pl -> http://www.gazeta.pl/usenet/
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads