Problem z rozwijanym menu (nie zamyka się)
: wt cze 14, 2005 11:59 am
Witam,
Mam problem z rozwijanym menu. Znalzlem je w open sourcach i przerobilem (o tu jest http://www.flashzone.pl/item-164-multilevel-menu.html#
). Ogolnie menu jest wstawione na stronie za pomoca div'ow z position: absolute i z przezroczystym tlem. Problem polega na tym ze jak zrobie transparentne tlo to menu "nie wie" o tym ze kursor z niego zjechal i sie nie zamyka. Moze ktos potrafi zmodyfikowac ponizszy kod tak, zeby nie bylo tego problemu Bede bardzo wdzieczny 
[php]<?
pokazStrony = function () {
this._parent.strony_mc._visible = true;
delete this._parent.strony_mc.onMouseMove;
};
sprawdzKursor = function () {
if (!this.hitTest(_root._xmouse, _root._ymouse, false)) {
if (this.pressed) {
return;
}
this._visible = false;
delete this.onMouseMove;
}
};
sprawdzKursor2 = function () {
if (!this.hitTest(_root._xmouse, _root._ymouse, false)) {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
this._visible=false;
delete this.onMouseMove;
}
};
/*
* Skrypty do klipu o nazwie dzial_2
*/
with (dzial_2) {
strony_mc._visible = false;
glowny.onRollOver = pokazStrony;
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
strony_mc.strona4.onRelease = function() {
getURL("");
};
strony_mc.strona6.onRelease = function() {
getURL('');
};
podstrony1_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony1_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony1_mc.podstrona3.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona3.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona4.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona5.onRelease = function() {
getURL('');
};
podstrony3_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony3_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony3_mc.podstrona3.onRelease = function() {
getURL('');
};
podstrony3_mc.podstrona4.onRelease = function() {
getURL('');
};
podstrony5_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony5_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony5_mc.podstrona3.onRelease = function() {
getURL('');
};
podstrony7_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony7_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony1_mc._visible = false;
podstrony2_mc._visible = false;
podstrony3_mc._visible = false;
podstrony5_mc._visible = false;
podstrony7_mc._visible = false;
strony_mc.strona1.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony1_mc._visible = true;
};
strony_mc.strona1.onRollOut = strony_mc.strona3.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony1_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
strony_mc.strona2.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony2_mc._visible = true;
};
strony_mc.strona2.onRollOut = strony_mc.strona2.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony2_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
strony_mc.strona3.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony3_mc._visible = true;
};
strony_mc.strona3.onRollOut = strony_mc.strona3.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony3_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
strony_mc.strona5.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony5_mc._visible = true;
};
strony_mc.strona5.onRollOut = strony_mc.strona5.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony5_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
strony_mc.strona7.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony7_mc._visible = true;
};
strony_mc.strona7.onRollOut = strony_mc.strona7.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony7_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
}
/*
* Skrypty do klipu o nazwie
*/
with (dzial_1) {
strony_mc._visible = false;
glowny.onRollOver = pokazStrony;
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
strony_mc.strona1.onRelease = function() {
getURL('');
};
strony_mc.strona2.onRelease = function() {
getURL('');
};
strony_mc.strona3.onRelease = function() {
getURL('');
};
strony_mc.strona4.onRelease = function() {
getURL('');
};
strony_mc.strona5.onRelease = function() {
getURL('');
};
strony_mc.strona6.onRelease = function() {
getURL('');
};
strony_mc.strona7.onRelease = function() {
getURL('');
};
strony_mc.strona8.onRelease = function() {
getURL('');
};
strony_mc.strona9.onRelease = function() {
getURL('');
};
strony_mc.strona10.onRelease = function() {
getURL('');
};
strony_mc.strona11.onRelease = function() {
getURL('');
};
strony_mc.strona12.onRelease = function() {
getURL('');
};
strony_mc.strona13.onRelease = function() {
getURL('');
};
strony_mc.strona14.onRelease = function() {
getURL('');
};
}
/*
* Skrypty do klipu o nazwie strona glowna
*/
with (dzial_3) {
strony_mc._visible = false;
glowny.onRelease = function() {
getURL('');
};
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
}
/*
* Skrypty do klipu o nazwie
*/
with (dzial_4) {
strony_mc._visible = false;
glowny.onRelease = function() {
getURL('');
};
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
}
/*
* Skrypty do klipu o nazwie
*/
with (dzial_5) {
strony_mc._visible = false;
glowny.onRelease = function() {
getURL('');
};
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
}
/*
* Skrypty do klipu o nazwie kontakt
*/
with (dzial_6) {
strony_mc._visible = false;
glowny.onRollOver = pokazStrony;
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
strony_mc.strona1.onRelease = function() {
getURL('');
};
strony_mc.strona2.onRelease = function() {
getURL('');
};
}?>
[/php]
Pozdrawiam
Mam problem z rozwijanym menu. Znalzlem je w open sourcach i przerobilem (o tu jest http://www.flashzone.pl/item-164-multilevel-menu.html#
[php]<?
pokazStrony = function () {
this._parent.strony_mc._visible = true;
delete this._parent.strony_mc.onMouseMove;
};
sprawdzKursor = function () {
if (!this.hitTest(_root._xmouse, _root._ymouse, false)) {
if (this.pressed) {
return;
}
this._visible = false;
delete this.onMouseMove;
}
};
sprawdzKursor2 = function () {
if (!this.hitTest(_root._xmouse, _root._ymouse, false)) {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
this._visible=false;
delete this.onMouseMove;
}
};
/*
* Skrypty do klipu o nazwie dzial_2
*/
with (dzial_2) {
strony_mc._visible = false;
glowny.onRollOver = pokazStrony;
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
strony_mc.strona4.onRelease = function() {
getURL("");
};
strony_mc.strona6.onRelease = function() {
getURL('');
};
podstrony1_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony1_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony1_mc.podstrona3.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona3.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona4.onRelease = function() {
getURL('');
};
podstrony2_mc.podstrona5.onRelease = function() {
getURL('');
};
podstrony3_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony3_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony3_mc.podstrona3.onRelease = function() {
getURL('');
};
podstrony3_mc.podstrona4.onRelease = function() {
getURL('');
};
podstrony5_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony5_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony5_mc.podstrona3.onRelease = function() {
getURL('');
};
podstrony7_mc.podstrona1.onRelease = function() {
getURL('');
};
podstrony7_mc.podstrona2.onRelease = function() {
getURL('');
};
podstrony1_mc._visible = false;
podstrony2_mc._visible = false;
podstrony3_mc._visible = false;
podstrony5_mc._visible = false;
podstrony7_mc._visible = false;
strony_mc.strona1.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony1_mc._visible = true;
};
strony_mc.strona1.onRollOut = strony_mc.strona3.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony1_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
strony_mc.strona2.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony2_mc._visible = true;
};
strony_mc.strona2.onRollOut = strony_mc.strona2.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony2_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
strony_mc.strona3.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony3_mc._visible = true;
};
strony_mc.strona3.onRollOut = strony_mc.strona3.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony3_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
strony_mc.strona5.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony5_mc._visible = true;
};
strony_mc.strona5.onRollOut = strony_mc.strona5.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony5_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
strony_mc.strona7.onRollOver = function() {
this._parent.pressed = true;
this._parent._parent.podstrony7_mc._visible = true;
};
strony_mc.strona7.onRollOut = strony_mc.strona7.onDragOut=function () {
delete this._parent.onMouseMove;
this._parent.pressed = false;
this._parent._parent.podstrony7_mc.onMouseMove = this._parent._parent._parent.sprawdzKursor2;
};
}
/*
* Skrypty do klipu o nazwie
*/
with (dzial_1) {
strony_mc._visible = false;
glowny.onRollOver = pokazStrony;
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
strony_mc.strona1.onRelease = function() {
getURL('');
};
strony_mc.strona2.onRelease = function() {
getURL('');
};
strony_mc.strona3.onRelease = function() {
getURL('');
};
strony_mc.strona4.onRelease = function() {
getURL('');
};
strony_mc.strona5.onRelease = function() {
getURL('');
};
strony_mc.strona6.onRelease = function() {
getURL('');
};
strony_mc.strona7.onRelease = function() {
getURL('');
};
strony_mc.strona8.onRelease = function() {
getURL('');
};
strony_mc.strona9.onRelease = function() {
getURL('');
};
strony_mc.strona10.onRelease = function() {
getURL('');
};
strony_mc.strona11.onRelease = function() {
getURL('');
};
strony_mc.strona12.onRelease = function() {
getURL('');
};
strony_mc.strona13.onRelease = function() {
getURL('');
};
strony_mc.strona14.onRelease = function() {
getURL('');
};
}
/*
* Skrypty do klipu o nazwie strona glowna
*/
with (dzial_3) {
strony_mc._visible = false;
glowny.onRelease = function() {
getURL('');
};
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
}
/*
* Skrypty do klipu o nazwie
*/
with (dzial_4) {
strony_mc._visible = false;
glowny.onRelease = function() {
getURL('');
};
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
}
/*
* Skrypty do klipu o nazwie
*/
with (dzial_5) {
strony_mc._visible = false;
glowny.onRelease = function() {
getURL('');
};
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
}
/*
* Skrypty do klipu o nazwie kontakt
*/
with (dzial_6) {
strony_mc._visible = false;
glowny.onRollOver = pokazStrony;
glowny.onRollOut = glowny.onDragOut=function () {
this._parent.strony_mc.onMouseMove = this._parent._parent.sprawdzKursor;
};
strony_mc.strona1.onRelease = function() {
getURL('');
};
strony_mc.strona2.onRelease = function() {
getURL('');
};
}?>
[/php]
Pozdrawiam