Search Results

Search found 4335 results on 174 pages for 'wait'.

Page 9/174 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • how to wait multiple function processing to finish

    - by user351412
    I have a problem about multiple function processing , listed as below code, the main function is btnEvalClick, I have try to use alter native 1and 2 to wait the function not move to next record before theprocessed function finish, but it does not work //private function btnEvalClick(event:Event):void { // var i:int; // for(i= 0; i < (dataArr1.length); i++) { // dispatchEvent( new FlexEvent('test') ); // callfunc1('cydatGMX'); //call function 1 // callfun2('cydatGMO'); //call function 1 // editSave(); //save record (HTTP) //## Alternative 1 //if (String(event) == 'SAVEOK') { // RecMov('next'); //move record if save = OK //} //## Alternative 2 //while (waitfc == '') // if waitfc not 'OK' continue looping //{ // z = z + 1; //} // RecMov('next'); //Move to next record to process //} //private function callfunc1(tasal:String):void { // var mySO :SharedObject; // var myDP: Array; // var i:int; // var prm:Array; // try // { // mySO = SharedObject.getLocal(tasal,'/'); // prm = mySO.data.txt.split('?'); // for(i=0; i < (prm.length - 1); i++) { // myDP = prm[i].toString().split('^'); // if ( myDP[0].toString() == String(dataArr1[dg].MatrixCDCol)){ // myDPX = myDP; // break; // } // } // } // catch (err:Error) { // Alert.show('Limit object creation fail (' + tasal + '), please retry ); // } //} //private function editSave():void //{ // var parameters:* = // { // 'CertID': CertIDCol.text, 'AssetID': AssetIDCol.text, 'CertDate': cdt, //'Ccatat': CcatatCol.text, 'CertBy': CertByCol.text, 'StatusID': StatusIDCol.text, //'UpdDate': lele, 'UpdUsr': ApplicationState.instance.luNm }; // doRequest('Update', parameters, saveItemHandler); //} //private function doRequest(method_name:String, parameters:Object, callback:Function):void // { // add the method to the parameters list // parameters['method'] = (method_name + 'ASC'); // gateway.request = parameters; // var call:AsyncToken = gateway.send(); // call.request_params = gateway.request; // call.handler = callback; // } //private function saveItemHandler(e:Object):void // { // if (e.isError) // { // Alert.show('Error: ' + e.data.error); // } // else // { // Alert.show('Record Saved..'); // waitfc = 'OK'; // dispatchEvent( new FlexEvent('SAVEOK') ); // } // }

    Read the article

  • Sleep a thread until an event is attended in another thread from a different class

    - by Afro Genius
    I have an application that fires 2 threads, the 1st launches another class to do some processing which in turn launches a 3rd class to do yet more processing. The 2nd thread in the main class should wait until some event in the 3rd class completes before it performs its job. How can this be achieved? I had tried implementing a wait/notify to share a lock object between the two threads but technically this will not work as I found the hard way. Can I share a lock between classes? Note, an instance of the 3rd class is declared in the 1st class and passed as parameter to the 2nd class. Also I tried creating boolean value in 3rd class that tells when event is complete then poll 2nd thread till this value is true. This worked but is not very desirable. Also is actionListner a better approach to this problem?

    Read the article

  • How can I kill and wait for background processes to finish in a shell script when I Ctrl+C it?

    - by slipheed
    I'm trying to set up a shell script so that it runs background processes, and when I ctrl+C the shell script, it kills the children, then exits. The best that I've managed to come up with is this. It appears that kill 0 -INT also kills the script before the wait happens, so the shell script dies before the children complete. Any ideas on how I can make this shell script wait for the children to die after sending INT? #!/bin/bash trap 'killall' INT killall() { echo **** Shutting down... **** kill 0 -INT wait # Why doesn't this wait?? echo DONE } process1 & process2 & process3 & cat # wait forever

    Read the article

  • Windows XP waits for usb drive on almost every operation.

    - by Tomasz Kowalczyk
    Hello everyone, I have a problem with my Windows XP operating system, particularly with the USB device that is plugged in - 1TB WD My Book external drive. I haven't found any information about such behaviour when searching in Internet, so I have to ask You. The problem is: when I am using computer, especially during work (programming), when I try to access any information on a hard disk ("internal" one), Windows seems to "consult" it with the external drive. For example, when I open file selection dialog window, if I try to change directory, system activates external drive, reads something (I hear the disk's operational noise) and after some seconds of such pause it makes the operations I requested. There are many situations in which I can reproduce this behavior - opening My Computer, shutting down system, opening partition folder from My Computer - every operation involves the usage of external drive. Please understand me properly - this is not something that happens EVERY time, but at least "many" times a day. What causes such behavior and how can I "turn off" external drive when it's not needed? Thanks in advance for your answers.

    Read the article

  • Hang while starting several daemons [solved]

    - by Adrian Lang
    I’m running a Debian Squeeze AMD64 server. Target runlevel after boot is runlevel 2, which includes rsyslogd, cron, sshd and some other stuff, but not dovecot, postfix, apache2, etc. The system fails to reach runlevel 2 with several symptoms: The system hangs at trying to start rsyslogd Booting into runlevel 1 works, then login from the console works Starting rsyslogd from runlevel 1 via /etc/init.d/rsyslog hangs Starting runlevel 2 with rsyslogd disabled works But then, logging in via console fails: I get the motd, and then nothing Starting sshd from runlevel 1 succeeds But then, I cannot login via ssh. Sometimes password ssh login gives me the motd and then nothing, sometimes not even this. Trying to offer a public key seems to annoy the sshd enough to not talk to me any further. When rebooting from runlevel 1, the server hangs at trying to stop apache2 (which is not running, so this really should be trivial). Trying to stop apache2 when logged in in runleve 1 does hang as well. And that’s just the stuff which fails all the time. RAM has been tested, dmesg shows no problems. I have no clue. Update: (shortened) output from rsyslogd -c4 -d called in runlevel 1 rsyslogd 4.6.4 startup, compatibility mode 4, module path '' caller requested object 'net', not found (iRet -3003) Requested to load module 'lmnet' loading module '/user/lib/rsyslog/lmnet.so' module of type 2 being loaded conf.c requested ref for 'lmnet', refcount 1 rsylog runtime initialized, version 4.6.4, current users 1 syslogd.c requested ref for 'lmnet', refcount now 2 I can kill rsyslogd with Strg+C, then. /var/log shows none of the configured log files, though. Update2: Thanks to @DerfK I still have no clue, but at least I narrowed down the problem. I’m now testing with /etc/init.d/apache2 stop (without an apache2 running, of course) which hangs as well and looks like an even more obvious failure. After some testing I found out that a file with one single line: /usr/sbin/apache2ctl configtest /dev/null 2&1 hangs, while the same line executed in an interactive shell works. I was not able to further reduce this line while, i. e. every single part, the stream redirections and the commando itself is necessary to reproduce the hang. @DerfK also pointed me to strace which gave a shallow hint about what kind of hang we have here: wait4(-1for the init scripts futex(0xsomepointer, FUTEX_WAIT_PRIVATE, 2, NULL for rsyslogd / apache2 binaries called by the init scripts The system was installed as a Debian Lenny by my hoster in autumn 2011, I upgraded it to Squeeze immediately and kept it up to date with Squeeze, which then used to be testing. There were no big changes, though. I guess I never tried to reboot the system before. Update3: I found the problem. My /etc/nsswitch.conf specified ldap as hosts lookup backup, which is not available at that time of the boot. Relying on dns solely fixes my boot problems.

    Read the article

  • Hang while starting several daemons

    - by Adrian Lang
    I’m running a Debian Squeeze AMD64 server. Target runlevel after boot is runlevel 2, which includes rsyslogd, cron, sshd and some other stuff, but not dovecot, postfix, apache2, etc. The system fails to reach runlevel 2 with several symptoms: The system hangs at trying to start rsyslogd Booting into runlevel 1 works, then login from the console works Starting rsyslogd from runlevel 1 via /etc/init.d/rsyslog hangs Starting runlevel 2 with rsyslogd disabled works But then, logging in via console fails: I get the motd, and then nothing Starting sshd from runlevel 1 succeeds But then, I cannot login via ssh. Sometimes password ssh login gives me the motd and then nothing, sometimes not even this. Trying to offer a public key seems to annoy the sshd enough to not talk to me any further. When rebooting from runlevel 1, the server hangs at trying to stop apache2 (which is not running, so this really should be trivial). Trying to stop apache2 when logged in in runleve 1 does hang as well. And that’s just the stuff which fails all the time. RAM has been tested, dmesg shows no problems. I have no clue. Update: (shortened) output from rsyslogd -c4 -d called in runlevel 1 rsyslogd 4.6.4 startup, compatibility mode 4, module path '' caller requested object 'net', not found (iRet -3003) Requested to load module 'lmnet' loading module '/user/lib/rsyslog/lmnet.so' module of type 2 being loaded conf.c requested ref for 'lmnet', refcount 1 rsylog runtime initialized, version 4.6.4, current users 1 syslogd.c requested ref for 'lmnet', refcount now 2 I can kill rsyslogd with Strg+C, then. /var/log shows none of the configured log files, though. Update2: Thanks to @DerfK I still have no clue, but at least I narrowed down the problem. I’m now testing with /etc/init.d/apache2 stop (without an apache2 running, of course) which hangs as well and looks like an even more obvious failure. After some testing I found out that a file with one single line: /usr/sbin/apache2ctl configtest /dev/null 2&1 hangs, while the same line executed in an interactive shell works. I was not able to further reduce this line while, i. e. every single part, the stream redirections and the commando itself is necessary to reproduce the hang. @DerfK also pointed me to strace which gave a shallow hint about what kind of hang we have here: wait4(-1for the init scripts futex(0xsomepointer, FUTEX_WAIT_PRIVATE, 2, NULL for rsyslogd / apache2 binaries called by the init scripts The system was installed as a Debian Lenny by my hoster in autumn 2011, I upgraded it to Squeeze immediately and kept it up to date with Squeeze, which then used to be testing. There were no big changes, though. I guess I never tried to reboot the system before.

    Read the article

  • Newly configured MSSQL2008, TIME_WAIT but no ESTABLISHED?

    - by 3molo
    Windows 2008 R2, standard. No firewall locally on it. Newly setup because an old SQL2000 had two disks die (or could it be the raid controller?) at the same time. Luckily, I had fresh backups. The databases have been restored, and SP2 for SQL2008 applied. I can see various hosts trying to establish a session, but the (customer) sites does not work and I don't see the expected established sessions. A wireshark reveals a full three-way handshake. Since it's customer machines connecting, I cannot logon to them and restart application pools.. What on earth could be causing this? No. Time Source Destination Protocol Info 1 0.000000 1.2.5.127 1.2.6.133 TCP desktop-dna > ms-sql-s [SYN] Seq=0 Win=65535 Len=0 MSS=1380 SACK_PERM=1 Frame 1: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) Ethernet II, Src: Cisco_31:5e:09 (00:26:0b:31:5e:09), Dst: Vmware_b7:00:05 (00:50:56:b7:00:05) Internet Protocol, Src: 1.2.5.127 (1.2.5.127), Dst: 1.2.6.133 (1.2.6.133) Transmission Control Protocol, Src Port: desktop-dna (2763), Dst Port: ms-sql-s (1433), Seq: 0, Len: 0 No. Time Source Destination Protocol Info 2 0.000123 1.2.6.133 1.2.5.127 TCP ms-sql-s > desktop-dna [SYN, ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1460 SACK_PERM=1 Frame 2: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) Ethernet II, Src: Vmware_b7:00:05 (00:50:56:b7:00:05), Dst: Cisco_31:5e:09 (00:26:0b:31:5e:09) Internet Protocol, Src: 1.2.6.133 (1.2.6.133), Dst: 1.2.5.127 (1.2.5.127) Transmission Control Protocol, Src Port: ms-sql-s (1433), Dst Port: desktop-dna (2763), Seq: 0, Ack: 1, Len: 0 No. Time Source Destination Protocol Info 3 0.000884 1.2.5.127 1.2.6.133 TCP desktop-dna > ms-sql-s [ACK] Seq=1 Ack=1 Win=65535 Len=0 And netstat TCP 1.2.6.133:1433 1.2.2.98:26895 TIME_WAIT 0 TCP 1.2.6.133:1433 1.2.2.98:26912 TIME_WAIT 0 TCP 1.2.6.133:1433 1.2.2.98:26918 TIME_WAIT 0 TCP 1.2.6.133:1433 1.2.2.98:26931 TIME_WAIT 0 TCP 1.2.6.133:1433 1.2.5.127:2736 TIME_WAIT 0 TCP 1.2.6.133:1433 1.2.5.127:2737 TIME_WAIT 0 TCP 1.2.6.133:1433 1.2.5.127:2738 TIME_WAIT 0 TCP 1.2.6.133:1433 1.2.5.127:2739 TIME_WAIT 0

    Read the article

  • Redis connection issue

    - by mre
    We are currently experiencing a lot of Redis errors with the message Unable to connect: read error on connection, trying next server We run Redis on FreeBSD using PHP Redis and we have a hard time reproducing the error on Ubuntu so this might be a hint. There's a long-running issue on that topic on github. Basically we get a socket from the operating system with a call to connect(host, port, timeout) in phpredis, but when we do a select(db_index) afterwards, we get an exception. Could there be an issue with persistance? I assume that connect does nothing in the background and select tries to access the connection, which is actually closed. We don't run into a timeout. We tried tuning TIME_WAIT without success. Any other ideas on where the problem might come from? What is the best way to track the issue down? dtrace maybe? Update We are currently looking into our BGSAVE settings. Interestingly it takes half a second and more to create a fork for the process which regularly writes the data to disk (persistence) and maybe redis can't respond to connect() requests during that timespan.

    Read the article

  • All computers on network get stuck waiting for some sites indefinetely

    - by zacaj
    This happens across three computers, running windows 7 and Ubuntu, firefox, opera, and chrome (all latest versions). I am connected to the internet through a Verizon wireless usb modem. When I try to open some web pages they will never finish loading (and usually never even show anything). The status bar at the bottom of the browser will display "Waiting for X" The servers it gets stuck on include: platform.twitter.com s7.addthis.com connect.facebook.net ajax.googleapis.com 2mdn.net Ive been getting away with just blocking them in AdBlock up until now, however the last two have been causing problems. There are some sites which require googleapis.com to load correctly, and some that wont ever load unless its blocked. eBay requires access to 2mdn.net to load pictures. On top of this its getting really annoying having to update AdBlock across all these computers whenever a new site pops up. I'm hoping there's some easier way to fix this? The different sites causing the freeze indicate to me that it's either a problem on my end (somehow?) or some server side software that got updated with a new bug?

    Read the article

  • Rx framework: How to wait for an event to be triggered in silverlight test

    - by user324255
    Hi, I have a ViewModel that starts loading the Model async in the constructor, and triggers an event when the Model is loaded. I got a test working with the silverlight unit test framework, like this : bool done = false; [TestMethod] [Asynchronous] public void Test_NoCustomerSelected() { ProjectListViewModel viewModel = null; EnqueueCallback(() => viewModel = new ProjectListViewModel()); EnqueueCallback(() => viewModel.ModelLoaded += new EventHandler<EventArgs>(viewModel_ModelLoaded)); EnqueueConditional(() => done); EnqueueCallback(() => Assert.IsNotNull(viewModel.FilteredProjectList)); EnqueueCallback(() => Assert.AreEqual(4, viewModel.FilteredProjectList.Count)); EnqueueTestComplete(); } void viewModel_ModelLoaded(object sender, EventArgs e) { done = true; } But I'm beginning playing with Rx Framework, and trying to get my test to work, but so far I have no luck. Here's 2 attempts : public void Test_NoCustomerSelected2() { ProjectListViewModel viewModel = null; viewModel = new ProjectListViewModel(eventAggregatorMock.Object, moduleManagerMock.Object); IObservable<IEvent<EventArgs>> eventAsObservable = Observable.FromEvent<EventArgs>( ev => viewModel.ModelLoaded += ev, ev => viewModel.ModelLoaded -= ev); eventAsObservable.Subscribe(args => viewModel_ModelLoaded(args.Sender, args.EventArgs)); eventAsObservable.First(); Assert.IsNotNull(viewModel.Model); Assert.AreEqual(4, viewModel.Model.Count); } [TestMethod] public void Test_NoCustomerSelected3() { ProjectListViewModel viewModel = null; var o = Observable.Start(() => viewModel = new ProjectListViewModel(eventAggregatorMock.Object, moduleManagerMock.Object)); IObservable<IEvent<EventArgs>> eventAsObservable = Observable.FromEvent<EventArgs>( ev => viewModel.ModelLoaded += ev, ev => viewModel.ModelLoaded -= ev); o.TakeUntil(eventAsObservable) .First(); Assert.IsNotNull(viewModel.Model); Assert.AreEqual(4, viewModel.Model.Count); } The first test goes in waiting forever, the second doesn't work because the viewModel is null when it does the FromEvent. Anyone has a clue on how to do this properly?

    Read the article

  • How do I let main thread wait for the Timer.timer

    - by Kelvin
    Hi I am using System.Timer.Timer I always get NULL after running my programme and it only works if I add this.sleep(6000). Suppose the reason is the main thread ends but the timer hasn't finished ... Here is the class and I call the class from my main form. Class class1 { string finalResult = ""; public string getNumber() { RunTimer(); return finalResult; } pubic void RunTimer () { timer = new System.Timers.Timer(6000); timer.Interval = 1000; timer.Elapsed += new System.Timers.ElapsedEventHandler(cal); timer.Start(); } private void cal(object sender,System.Timers.ElapsedEventArgs e) { finalResult = READFROMCOMPORT; } }

    Read the article

  • jQuery .load() wait till content is loaded

    - by user1785870
    How to prevent jQuery $('body').load('something.php'); from changing any DOM till all the content from something.php (including images,js) is fully loaded -Lets say some actual content is: Hello world And something.php content is: image that loads for 10 seconds 20 js plugins After firing .load() function nothing should happen, till images an js files are fully loaded, and THEN instantly change the content. some preloader may appear, but its not subject of question.

    Read the article

  • Wait for function to finish before starting again.

    - by Matthew Brown
    Good Morning, I am trying to call the same function everytime the user presses a button. Here is what happens at the moment.. User clicks button - Calls function - function takes 1000ms+ to finish (due to animation with jQuery and AJAX calls) What I want to happen is every time the user presses the button it adds the function to the queue, waits for the previous call to finish, and then starts.. Is this possible? Sorry if my explanation is a bit confusing.. Thanks Matthew

    Read the article

  • jquery wait till large document is loaded

    - by Martijn
    In my web application I call a document can be huge. This document is loaded into an iframe. I have a title, buttons and the text which all depends on this document. The text is from the large document and is displayed in the iframe. I'd like to show an animated gif while the document is loading on 3 places (1: document title, 2: document buttons, 3: document text, the iframe) I've tried the onload event on the Iframe, but this doesn't give the me the desired effect. Here's my code that loads the document: function loadDocument(id, doc) { $("#DocumentContent").show(); $("#ButtonBox").show(); // Clear dynamic menu items $("#DynamicMenuContent").html(""); $("#PageContent").html(""); // Load document in frame $("#iframeDocument").attr("src", 'ViewDoc.aspx?id=' + id + '&doc=' + doc + ''); // $("#iframeDocument").attr("src", "Graphics/loader.gif"); // Load menu items $.ajax({ url: "ShowButtons.aspx?id=" + id + "&doc=" + doc, success: function(data) { $("#DynamicMenuContent").html(data) }, error: function(xhr, err, e) { alert("error: " + err) } }); // Set document title $("#documentTitle").load("GetDocumentInfo.aspx?p=title"); } My questions, how can I display a loader gif while the document is loaded? And remove the gif when the document is ready?

    Read the article

  • Wait until all threads teminated in ThreadPool

    - by Neir0
    Hi i have this code: var list = new List<int>(); for(int i=0;i<10;i++) list.Add(i); for(int i=0;i<10;i++) { ThreadPool.QueueUserWorkItem( new WaitCallback(x => { Console.WriteLine(x); }),list[i]); } And i want to know when all threadpools threads finished their work. How i can to do that?

    Read the article

  • ProcessCmdKey - wait for KeyUp?

    - by Tom Frey
    Hi, I'm having the following issue in a WinForms app. I'm trying to implement Hotkeys and I need to process Key messages whenever the control is active, no matter if the focus is on a textbox within that control, etc. Overriding ProcessCmdKey works beautifully for this and does exactly what I want with one exception: If a user presses a key and keeps it pressed, ProcessCmdKey keeps triggering WM_KEYDOWN events. However, what I want to achieve is that the user has to release the button again before another hotkey action would trigger (so, if someone sits on the keyboard it would not cause continuous hotkey events). However, I can't find where to catch WM_KEYUP events, so I can set a flag if it should process ProcessCmdKey messages again? Anyone can help out here? Thanks, Tom

    Read the article

  • orale clients dead wait

    - by Macroideal
    hi all friends I meet a problem yestoday...maybe it's becoz it is april 1st... but it did exist. here i begin clarifying: i have 3 pcs in remote area..2 clients and 1 oracle server.. my app is running seperately in the two clients hourly connecting to the oracles,,my clients worked well be4 April 1th, but suddenly my app in the clients mechines went down...first i did not change any configurations.... i used libsqlora8 to connect the server...I went into a dead loop in the library...I tried sqlplus, but it dead there in my shell terminal, like it meets a infinite loop....no return until i pressed ctrl + c, the reason i guess is "infinite loop" somewhere..... btw, when i used my local pc to connect the server, it worked well...just from this phenomenon, wen can see the is problems lie in the client mechines..and i check the configuration file both in local mechine and client mechines..they are identical have you met a problem like this.... I dont hope it's frank of April 1st

    Read the article

  • Ruby Multithreading: making one thread wait for a signal from another

    - by Peter
    In Ruby, I want to have two threads running at the same time, and want the background thread to periodically signal the foreground thread. How do I get the foreground thread to block until the background thread says 'go'? I can think of a few ways to do it, but am after the most appropriate, idiomatic Ruby method. In code: loop do # background, thread 1 sleep 3 receive_input # tell foreground input is ready # <-- how do I do this? end and loop do # foreground, thread 2 wait_for_signal_from_background # <-- how do I do this? do_something end

    Read the article

  • sleep/wait in android apps

    - by Lynnooi
    Hi, I had an activity which calls a thread for 10times one after another. However, if the network is slow or too much information loaded, force close will occur. Will adding sleep in each thread help to solve this problem? or is there any other ways to solve it?

    Read the article

  • Loading...Please wait for UIWebView - iPhone

    - by niha7229
    Hi guys, In Safari and other browsers, there is a bar that would indicate the percentage of the loading progress, and I, myself, trying to implement something similiar on iPhone, when loading some content in UIWebView, I would like the app to indicate the percentage of the page being loaded. I tried some google search and realize we could use NSURLConnection to read only the header and get the Content-Length ( but don't know how to, I read the Apple's NSURLConnection docs but probably I missed something ... ). And the size ( kb ) which UIWebView had loaded, seem like UIWebView don't support it for the public API... I hope this would be complete in some other ways than I thought, so if you have any ideas, please throw it out, thanks for your patient reading. P.S : I could just show an Activities Indicator for users with the long loading progress actions of the UIWebView but I just want to go further with the loading percentage bar :). Regards.

    Read the article

  • Java CountDownLatch used to wait for JFrame to dispose

    - by Brian
    I have referenced this previous question as well as other sources, but cannot get CountDownLatch to work correctly. Background: mainFrame creates new Frame called dataEntryFrame. When dataEntryFrame "Submit" button is clicked, record added to database and dataEntryFrame disposed. At this point, mainFrame should clear and reload a jList that shows all records. Issue: When dataEntryFrame loads, java freezes, dataEntryFrame components never load. I cannot get past this part... then, in the DataEntryFrame, CountDownLatch should only decrements after the submit button is clicked, successfully adds a record to a database table, and disposes itself. Or when the user clicks cancel... Code: From MainFrame CountDownLatch dataEntryDone = new CountDownLatch(1); DataEntryFrame f = new DataEntryFrame(dataEntryDone); Thread newThread = new Thread(f); newThread.start(); dataEntryDone.await(); Code: From DataEntryFrame public void run(){ initComponents(); loadOtherData(); this.setVisible(true); } void submit(){ addRecord(); this.dispose() dataEntryDone.countDown(); }

    Read the article

  • Wait 300ms and then slide down menu using jQuery

    - by Derfder
    I tried this js code: <script type="text/javascript"> $(document).ready( function() { var timer; $('.top-menu-first-ul li').hover(function(){ if(timer) { clearTimeout(timer); timer = null } timer = setTimeout(function() { $(this).find('ul').slideToggle(100); }, 500) }, // mouse out }); }); </script> with this html: <ul class="top-menu-first-ul"> <li> <a href="http://google.com">Google</a> <ul class="top-menu-second-ul"> <li><a href="http://translate.google.com">Google Translate</a></li> <li><a href="http://images.google.com">Google Images</a></li> <li><a href="http://gmail.google.com">Gmail</a></li> <li><a href="http://plus.google.com">Google Plus</a></li> </ul> </li> <li> <a href="http://facebook.com">Facebook</a> </li> <li> <a href="http://twitter.com">Twitter</a> </li> </ul> but it is not working. I would like to show the submenu when hovering over e.g. Google link and other will appear after 300ms. So, I need to prevent loading submenu when the user just quickly hover over it and not stay on hover link for at least 300ms. Then I need to stop executing code (or slide up) when he leaves the link. Because if he go over and back and over and back a copule of times he stop doing hovering anfd the code is still executing itself how many times he had hover over the link. I need somehow prevent this to happen. EDIT: I need to solve this without plugins like hoverIntent etc. if possible, just plain javascript and jQuery

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >