延迟子菜单(Delay a submenu)
我做了一个剧本。 这在导航中打开了我的子菜单。 当你将鼠标移出子菜单时。 子菜单必须以300毫秒的延迟关闭。 但延迟不起作用。 我怎样才能解决这个问题? 这是我的脚本:
$('.nav-main .container li').hover(function() { if ($(this).find('.submenu').length > 0) { $(this).addClass("hover"); $(this).find('.submenu').show(); } }, function() { $(this).find('.submenu').delay(300).hide(); $(this).removeClass("hover"); });
I have make a script. That open my submenu in the navigation. When you go mouse out of the submenu. The submenu must be closed with a delay of 300ms. But the delay is not working. How can i fix this? This is my script:
$('.nav-main .container li').hover(function() { if ($(this).find('.submenu').length > 0) { $(this).addClass("hover"); $(this).find('.submenu').show(); } }, function() { $(this).find('.submenu').delay(300).hide(); $(this).removeClass("hover"); });
原文:https://stackoverflow.com/questions/10363562
更新时间:2022-06-23 18:06
最满意答案
帮助代表真正的回答用户。 注释掉补间并再次检查
public function Patch() { this.addEventListener (Event.ADDED_TO_STAGE, addedToStageHandler); } private function addedToStageHandler(evt:Event) { _stageW = stage.stageWidth; _cropArray = new Array(); this.x = 55; this.y = 76; _stageW = 800; //FIXME: Coded hard // _transition = new Tween (this, "x", Regular.easeInOut, 0, 0, 1, true); // _transition.stop(); }
Helping on behalf of the real answering user. Comment out a tween and check again
public function Patch() { this.addEventListener (Event.ADDED_TO_STAGE, addedToStageHandler); } private function addedToStageHandler(evt:Event) { _stageW = stage.stageWidth; _cropArray = new Array(); this.x = 55; this.y = 76; _stageW = 800; //FIXME: Coded hard // _transition = new Tween (this, "x", Regular.easeInOut, 0, 0, 1, true); // _transition.stop(); }
相关问答
更多-
你不需要为这样的副作用编写自己的setter。 使用KVO ! 使拥有该按钮的控制器观察该对象的reminder属性: [reminderOwner addObserver:self forKeyPath:@"reminder" options:NSKeyValueObservingOptionNew context:NULL]; options参数指定在进行观察时您想要传递的被观察对象的状态的信息 ...
-
不幸的是,这是不可能的。 只使用自定义oldstyle setter和getter,如setFahrenheit(value:int)和getFahrenheit():int Unfortunately, this is impossible. Only using custom oldstyle setters and getters like setFahrenheit(value:int) and getFahrenheit():int
-
这应该工作: var obj:Object = new Object(); obj["something"] = 12; This should work: var obj:Object = new Object(); obj["something"] = 12;
-
首先,你必须在一个属性上使用'get'。 代替: console.log(this.controllerFor('index').latitude); 写 console.log(this.controllerFor('index').get('latitude')); 其次,navigator.geolocation.getCurrentPosition以异步方式运行并立即返回,因此您的console.log在设置纬度之前运行,但在它返回之后。 第三,模型钩子在控制器建立之前运行。 第四,模型必须是一 ...
-
你想使用getChildByName(“name”) 更多信息 import flash.display.MovieClip; // create boxes for(var i:int = 0 ; i < 4; i++){ var box:MovieClip = new myBox(); // myBox is a symbol in the library (export for actionscript is checked and class name is myBox box. ...
-
很遗憾,您的要求都不可能。 JavaScript中的对象文字很方便但有缺点,大多数是你发现的。 当您在对象文字中时,该对象尚不存在。 JavaScript解释器还没有完成它的摄取。 因此,在文字内部, this指向文字外部的对象,文字无法引用自身的其他部分。 幸运的是,你可以在文字声明之后只做它想做的两件事。 myObject = { someString: 'text', someArray: ['one', 'two'] }; myObject.someArray.customProp ...
-
AS3索引数组对象属性(AS3 indexof array object property)[2022-09-10]
我建议调查像TweenLite这样基于时间动画的补间实用程序:( http://www.greensock.com/tweenlite/ ) 还建议查看对象池,重用对象而不是创建新对象。 作为一名新程序员学习的好事。 你的问题在哪里是对的 我通过以下更改使您的程序正常工作: ---------change these lines------------- //star enter frame code for (var i:int = 0; i < numStars; i++) { starArr ... -
帮助代表真正的回答用户。 注释掉补间并再次检查 public function Patch() { this.addEventListener (Event.ADDED_TO_STAGE, addedToStageHandler); } private function addedToStageHandler(evt:Event) { _stageW = stage.stageWidth; _cropArray = new Array(); this.x = 55; this.y = 76; _sta ...
-
MKMapView的visibleMapRect属性没有正确设置地图区域?(MKMapView's visibleMapRect property does not set map area correctly?)[2022-02-10]
我想这是因为你的MKMapView的宽高比与你的MKMapRect的比例不同,但没有进一步的信息,这很难说。 你能提供你想要设置的MapRect的日志和返回的日志吗? I would imagine that this is because the aspect ratio of your MKMapView is different from the ratio of your MKMapRect but without further information it's hard to tell. Cou ... -
使用get / set函数时,您正在控制对成员变量的访问。 例如,如果您希望变量从外部“只读”,但可以从类实例中编辑,则可以创建一个get函数,以便可以从外部读取但不创建set函数。 这与使用私有const不同,因为它必须立即声明,并且永远不能从任何地方更改。 同样,使用这些函数可以允许您创建用于设置属性的副作用。 例如: public function set foo(value:*):void{ _foo = value; this.dispatchEvent(new Event("fo ...