[jQuery] jQuery(ul.lavaLamp).hoverIntent is not a function
Hello I have a problem with hoverIntent function. For some reason i get error mentioned in subject. I know jquery conflicts with prototype in this case so i used jquery noconflict. For some reason hoverIntent function still does not work. I changed hoverintent.js to have jQuery instead of $ in it - still no luck. My file has such scripts: script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery-1.3.2.js/script {literal} script type=text/javascript jQuery.noConflict(); /script {/literal} script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.easing.min.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.hoverIntent.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.localscroll-1.2.7-min.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.scrollTo-1.4.2-min.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/init.js/script Somewhere down the line CMS inserts prototype.js but i dont think it is important atm. Hoverintent is beeing used like this in init.js : jQuery(ul.lavaLamp).hoverIntent(function(){ jQuery(this).children(li).hoverIntent(function(){ jQuery(this).children(ul.levTwo).slideToggle('fast'); var el = jQuery(this); movehere(el); }, function(){ jQuery(this).children(ul.levTwo).slideToggle('fast'); }, 3, 100, 1000); },function(){ var el = jQuery(li.active); movehere(el); }, 1, 1, 10); Alan
[jQuery] jQuery(ul.lavaLamp).hoverIntent is not a function
Hello I have a problem with hoverIntent function. For some reason i get error mentioned in subject. I know jquery conflicts with prototype in this case so i used jquery noconflict. For some reason hoverIntent function still does not work. I changed hoverintent.js to have jQuery instead of $ in it - still no luck. My file has such scripts: script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery-1.3.2.js/script {literal} script type=text/javascript jQuery.noConflict(); /script {/literal} script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.easing.min.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.hoverIntent.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.localscroll-1.2.7-min.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.scrollTo-1.4.2-min.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/init.js/script Somewhere down the line CMS inserts prototype.js but i dont think it is important atm. Hoverintent is beeing used like this in init.js : jQuery(ul.lavaLamp).hoverIntent(function(){ jQuery(this).children(li).hoverIntent(function(){ jQuery(this).children(ul.levTwo).slideToggle('fast'); var el = jQuery(this); movehere(el); }, function(){ jQuery(this).children(ul.levTwo).slideToggle('fast'); }, 3, 100, 1000); },function(){ var el = jQuery(li.active); movehere(el); }, 1, 1, 10); Alan
[jQuery] Re: jQuery(ul.lavaLamp).hoverIntent is not a function
Ok... i tried all kinds of ways how to include init js on domready with noconflict and none of them helped. Plus noconflict docs say that if jquery is included before other libraries then there should be no need for noconflict anyway... so where is the problem? This is how init.js is beeing used: script type=text/javascript //![CDATA[ jQuery.noConflict(); jQuery(document).ready(function($){ init(); }); //]] /script Alan. On Jul 9, 3:27 pm, zayatzz alan.kesselm...@gmail.com wrote: Hello I have a problem with hoverIntent function. For some reason i get error mentioned in subject. I know jquery conflicts with prototype in this case so i used jquery noconflict. For some reason hoverIntent function still does not work. I changed hoverintent.js to have jQuery instead of $ in it - still no luck. My file has such scripts: script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery-1.3.2.js/script {literal} script type=text/javascript jQuery.noConflict(); /script {/literal} script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.easing.min.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.hoverIntent.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.localscroll-1.2.7-min.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/jquery.scrollTo-1.4.2-min.js/script script type=text/javascript src={$wwwroot}/extensions/ext_sanlab/ js/init.js/script Somewhere down the line CMS inserts prototype.js but i dont think it is important atm. Hoverintent is beeing used like this in init.js : jQuery(ul.lavaLamp).hoverIntent(function(){ jQuery(this).children(li).hoverIntent(function(){ jQuery(this).children(ul.levTwo).slideToggle('fast'); var el = jQuery(this); movehere(el); }, function(){ jQuery(this).children(ul.levTwo).slideToggle('fast'); }, 3, 100, 1000); },function(){ var el = jQuery(li.active); movehere(el); }, 1, 1, 10); Alan
[jQuery] Re: jQuery(ul.lavaLamp).hoverIntent is not a function
Any ideas why im getting this error? Alan
[jQuery] Re: jQuery(ul.lavaLamp).hoverIntent is not a function
The path is valid definately. I checked it with firebug plus it all works when im logged out of the CMS - you can see it working at http://www.sanlab.ee when you move your cursor into the menu. When i log in editor environment then the cms adds bunch of scripts to the page and then it stops working and web developer toolbar shows forementioned error. The same file is not beeing inserted after the call, but the jquery.js itself is beeing inserted by the CMS. I do not know why this would cause and error, because many other functions work just fine. Several other functions stop working too though, like colourpicker that is visible on the same page. Alan On Jul 9, 8:27 pm, Charlie charlie...@gmail.com wrote: is not a function means script you are referncing , in this case hoverintent, isn't accesible when you call the function. It shows you have it in page, but is path vaild? Is same file being inserted again after the call ( seen that cause function to fail too) can you post link? zayatzz wrote:Any ideas why im getting this error? Alan
[jQuery] Re: jQuery(ul.lavaLamp).hoverIntent is not a function
Yes that is what i've been saying. you get the error when you are logged in otherwise it works just fine. Unfortunately i cannot give you access to editor/admin environment. quoting my own words - it all works whem im logged out of CMS - Alan. On Jul 9, 9:06 pm, Charlie charlie...@gmail.com wrote: no idea. WOrked fine for me, no hoverintent error zayatzz wrote:The path is valid definately. I checked it with firebug plus it all works when im logged out of the CMS - you can see it working athttp://www.sanlab.eewhen you move your cursor into the menu. When i log in editor environment then the cms adds bunch of scripts to the page and then it stops working and web developer toolbar shows forementioned error. The same file is not beeing inserted after the call, but the jquery.js itself is beeing inserted by the CMS. I do not know why this would cause and error, because many other functions work just fine. Several other functions stop working too though, like colourpicker that is visible on the same page. Alan On Jul 9, 8:27 pm, Charliecharlie...@gmail.comwrote:is not a function means script you are referncing , in this case hoverintent, isn't accesible when you call the function. It shows you have it in page, but is path vaild? Is same file being inserted again after the call ( seen that cause function to fail too) can you post link? zayatzz wrote:Any ideas why im getting this error? Alan
[jQuery] Re: jQuery(ul.lavaLamp).hoverIntent is not a function
Ah hell... if you think it would be useful, then i can give you an account for testing too - not here though, via email, skype or msn. Alan. On Jul 9, 9:23 pm, zayatzz alan.kesselm...@gmail.com wrote: Yes that is what i've been saying. you get the error when you are logged in otherwise it works just fine. Unfortunately i cannot give you access to editor/admin environment. quoting my own words - it all works whem im logged out of CMS - Alan. On Jul 9, 9:06 pm, Charlie charlie...@gmail.com wrote: no idea. WOrked fine for me, no hoverintent error zayatzz wrote:The path is valid definately. I checked it with firebug plus it all works when im logged out of the CMS - you can see it working athttp://www.sanlab.eewhenyou move your cursor into the menu. When i log in editor environment then the cms adds bunch of scripts to the page and then it stops working and web developer toolbar shows forementioned error. The same file is not beeing inserted after the call, but the jquery.js itself is beeing inserted by the CMS. I do not know why this would cause and error, because many other functions work just fine. Several other functions stop working too though, like colourpicker that is visible on the same page. Alan On Jul 9, 8:27 pm, Charliecharlie...@gmail.comwrote:is not a function means script you are referncing , in this case hoverintent, isn't accesible when you call the function. It shows you have it in page, but is path vaild? Is same file being inserted again after the call ( seen that cause function to fail too) can you post link? zayatzz wrote:Any ideas why im getting this error? Alan
[jQuery] Re: jQuery(ul.lavaLamp).hoverIntent is not a function
Well i did some testing and figured it out - sort of, anyway. I renamed the jquery file that cms adds when user has logged in and voila... everything started working again. So i guess its a matter of that new jquery file. I guess there is no solution to this problem anyway, since i cannot just delete the second file - it is required in more then one place. I'll let those guys who made this CMS know about it. Basically the problem is (as much as i understand it) that cms adds new jquery file to the page and since it is added after my init call, it screws up everything that happens in that function. Alan On Jul 9, 9:40 pm, zayatzz alan.kesselm...@gmail.com wrote: Ah hell... if you think it would be useful, then i can give you an account for testing too - not here though, via email, skype or msn. Alan. On Jul 9, 9:23 pm, zayatzz alan.kesselm...@gmail.com wrote: Yes that is what i've been saying. you get the error when you are logged in otherwise it works just fine. Unfortunately i cannot give you access to editor/admin environment. quoting my own words - it all works whem im logged out of CMS - Alan. On Jul 9, 9:06 pm, Charlie charlie...@gmail.com wrote: no idea. WOrked fine for me, no hoverintent error zayatzz wrote:The path is valid definately. I checked it with firebug plus it all works when im logged out of the CMS - you can see it working athttp://www.sanlab.eewhenyoumove your cursor into the menu. When i log in editor environment then the cms adds bunch of scripts to the page and then it stops working and web developer toolbar shows forementioned error. The same file is not beeing inserted after the call, but the jquery.js itself is beeing inserted by the CMS. I do not know why this would cause and error, because many other functions work just fine. Several other functions stop working too though, like colourpicker that is visible on the same page. Alan On Jul 9, 8:27 pm, Charliecharlie...@gmail.comwrote:is not a function means script you are referncing , in this case hoverintent, isn't accesible when you call the function. It shows you have it in page, but is path vaild? Is same file being inserted again after the call ( seen that cause function to fail too) can you post link? zayatzz wrote:Any ideas why im getting this error? Alan
[jQuery] jquery(this) and has:ul selector.
Hello I have function like this: $(ul.lavaLamp li:has ul).hoverIntent(function(){ For various reasons i need to run other functions in this hoverintent function, some functions need to be run for all lavalamp ul li's not only those that have ul's. Therefore i have to run hoverintent like this instead: $(ul.lavaLamp li).hoverIntent(function() But what is the shortest way to run certain functions on those li's that have uls. if ($(this has:ul)) obviously does not work.. but is there a function that checks if element has certain children? something i could use like if ( $(this).has(element) ) Alan
[jQuery] Re: jquery(this) and has:ul selector.
Perhaps i should explain what im trying to achieve. What i want is menu where 1st menu has lavalamp background and some of the menu items have submenues that slide open. If i use ganesh's lavalamp and submenues together then lavalamp catches events on 1st level and prevents second level from opening. so i wanted to create something in between... but perhaps i dont have to, if there is similar function. Alan On Jun 27, 3:31 pm, zayatzz alan.kesselm...@gmail.com wrote: Hello I have function like this: $(ul.lavaLamp li:has ul).hoverIntent(function(){ For various reasons i need to run other functions in this hoverintent function, some functions need to be run for all lavalamp ul li's not only those that have ul's. Therefore i have to run hoverintent like this instead: $(ul.lavaLamp li).hoverIntent(function() But what is the shortest way to run certain functions on those li's that have uls. if ($(this has:ul)) obviously does not work.. but is there a function that checks if element has certain children? something i could use like if ( $(this).has(element) ) Alan
[jQuery] Re: jquery(this) and has:ul selector.
Thanks... but i actually chose somewhat different approach : and it works too: function movehere(el){ /* This bit is for moving the background of first ul - the lavalamp */ var w = $(el).width(); var pos = $(el).position(); var lleft = pos.left; $(li.back).animate({ width: w+px, left:lleft+px }, 500); } $(ul.lavaLamp).hoverIntent(function(){ /* This part is for general wrapper and its only real purpose is to move lavalamp li back to its position when mouse leaves the menu. Without this wrapper the lavalamp li would keep hopping back and forwards between its home position and li where mousecursor is */ $(this).children(li).hoverIntent(function(){ /* opens menu when mouse cursor is over li */ $(this).children(ul.levTwo).slideToggle('medium'); /* aparently there is no need for if, since if there is nothing to select, then it fails silently */ el = $(this); movehere(el); }, function(){ $(this).children(ul.levTwo).slideToggle('medium'); }, 3, 100, 1000); },function(){ el = $(li.active); /* and this part moves the lavalamp when cursor leaves menu */ movehere(el); }, 1000); And it works too... Alan. On Jun 27, 6:38 pm, Karl Swedberg k...@englishrules.com wrote: Try this: if ( $('ul', this).length ) { // do something if this li has a descendant ul } --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jun 27, 2009, at 8:31 AM, zayatzz wrote: Hello I have function like this: $(ul.lavaLamp li:has ul).hoverIntent(function(){ For various reasons i need to run other functions in this hoverintent function, some functions need to be run for all lavalamp ul li's not only those that have ul's. Therefore i have to run hoverintent like this instead: $(ul.lavaLamp li).hoverIntent(function() But what is the shortest way to run certain functions on those li's that have uls. if ($(this has:ul)) obviously does not work.. but is there a function that checks if element has certain children? something i could use like if ( $(this).has(element) ) Alan
[jQuery] Mouseleave event
Hello Is it possible to mouseleave event have some kind of delay inserted into it? I have this small script, which is working just fine : script type=text/javascript $(document).ready(function () { $(ul.LvlOne li:has(ul)).bind(mouseenter,function(event){ $(ul.LvlTwo).slideToggle('medium'); }); $(ul.LvlOne li:has(ul)).bind(mouseleave,function(event){ $(ul.LvlTwo).slideToggle('medium'); }); }); /script The problem is that the menu that opens is quite long and visitors of the site (me among them) move cursor down where menu is supposed to end up when its fully opened, but since the menu has not reached this far, the mouseleave event fires. When computer or browser is slow you can see even stranger thing. Menu gets mouseleave event and starts closing, but not before menu reaches the cursor. That means the menu gets mouseleave, then mouseenter, does not reach cursor before mouseleave event fires, then gets mouseenter again and keeps closing/opening/closing/opening/ closing/opening forever. So what i want to know, if it is possible to insert some kind of delays or doublechecks into the system to stop this kind of stuff from happening or should i just tell everybody to slow down their mouse movement? Alan
[jQuery] Re: Mouseleave event
Thanks. I did that: script type=text/javascript $(document).ready(function () { $(ul.LvlOne li:has(ul)).bind(mouseenter,function(event){ $(ul.LvlTwo).slideToggle('medium'); }); $(ul.LvlOne li:has(ul)).bind(mouseleave,function(event){ setTimeout(function () { $(ul.LvlTwo).slideToggle('medium'); }, 2000); }); }); /script Even with 4 second or longer delay it starts flashing at some point. It actually became worse, because now you have 2 seconds to get your mouse cursor back to where menu is supposed to be so you have even more chances for the menu to start jumping up and down, closed - open... Perhaps there should be somekind of doublecheck at mouseleave event that checks if the mouseenter on same element havent fired already? Alan. On Jun 2, 8:33 pm, Gustavo Salomé gustavon...@gmail.com wrote: Try the setTimeout function 2009/6/2 zayatzz alan.kesselm...@gmail.com Hello Is it possible to mouseleave event have some kind of delay inserted into it? I have this small script, which is working just fine : script type=text/javascript $(document).ready(function () { $(ul.LvlOne li:has(ul)).bind(mouseenter,function(event){ $(ul.LvlTwo).slideToggle('medium'); }); $(ul.LvlOne li:has(ul)).bind(mouseleave,function(event){ $(ul.LvlTwo).slideToggle('medium'); }); }); /script The problem is that the menu that opens is quite long and visitors of the site (me among them) move cursor down where menu is supposed to end up when its fully opened, but since the menu has not reached this far, the mouseleave event fires. When computer or browser is slow you can see even stranger thing. Menu gets mouseleave event and starts closing, but not before menu reaches the cursor. That means the menu gets mouseleave, then mouseenter, does not reach cursor before mouseleave event fires, then gets mouseenter again and keeps closing/opening/closing/opening/ closing/opening forever. So what i want to know, if it is possible to insert some kind of delays or doublechecks into the system to stop this kind of stuff from happening or should i just tell everybody to slow down their mouse movement? Alan -- Gustavo Salome Silva
[jQuery] Re: Mouseleave event
Thanks for the info This mouseintent is quite cool script. I did just what you suggested - i just removed the extra 2 seconds timeout and used config from the example instead. Thanks again. Alan On Jun 2, 9:41 pm, Gustavo Salomé gustavon...@gmail.com wrote: Check out this plugin:http://cherne.net/brian/resources/jquery.hoverIntent.html It may help you. Instead of mouseenter and leave do $('object').hoverIntent(function(){ $(ul.LvlTwo).slideToggle('medium'); },function(){ setTimeout(function () { $(ul.LvlTwo).slideToggle(' medium'); }, 2000); }); 2009/6/2 zayatzz alan.kesselm...@gmail.com Thanks. I did that: script type=text/javascript $(document).ready(function () { $(ul.LvlOne li:has(ul)).bind(mouseenter,function(event){ $(ul.LvlTwo).slideToggle('medium'); }); $(ul.LvlOne li:has(ul)).bind(mouseleave,function(event){ setTimeout(function () { $(ul.LvlTwo).slideToggle('medium'); }, 2000); }); }); /script Even with 4 second or longer delay it starts flashing at some point. It actually became worse, because now you have 2 seconds to get your mouse cursor back to where menu is supposed to be so you have even more chances for the menu to start jumping up and down, closed - open... Perhaps there should be somekind of doublecheck at mouseleave event that checks if the mouseenter on same element havent fired already? Alan. On Jun 2, 8:33 pm, Gustavo Salomé gustavon...@gmail.com wrote: Try the setTimeout function 2009/6/2 zayatzz alan.kesselm...@gmail.com Hello Is it possible to mouseleave event have some kind of delay inserted into it? I have this small script, which is working just fine : script type=text/javascript $(document).ready(function () { $(ul.LvlOne li:has(ul)).bind(mouseenter,function(event){ $(ul.LvlTwo).slideToggle('medium'); }); $(ul.LvlOne li:has(ul)).bind(mouseleave,function(event){ $(ul.LvlTwo).slideToggle('medium'); }); }); /script The problem is that the menu that opens is quite long and visitors of the site (me among them) move cursor down where menu is supposed to end up when its fully opened, but since the menu has not reached this far, the mouseleave event fires. When computer or browser is slow you can see even stranger thing. Menu gets mouseleave event and starts closing, but not before menu reaches the cursor. That means the menu gets mouseleave, then mouseenter, does not reach cursor before mouseleave event fires, then gets mouseenter again and keeps closing/opening/closing/opening/ closing/opening forever. So what i want to know, if it is possible to insert some kind of delays or doublechecks into the system to stop this kind of stuff from happening or should i just tell everybody to slow down their mouse movement? Alan -- Gustavo Salome Silva -- Gustavo Salome Silva
[jQuery] Posting form when pressing enter.
Hello $(function(){ $('input').keydown(function(e){ if (e.keyCode == 13) { $(this).parents('form').submit(); return false; } }); }); This script handles it very well, but it has some problems. Specially with browsers autocomplete. When i use this script and start typing in a value into form, then it offers complete word. When i press key down to choose it and press enter to select it, the form gets posted empty. Which blows. Is there a simple workaround to adapt with autocomplete or do i have to start counting enters - if up or down key has been pressed then 1st enter does nothing and 2nd posts the form? Alan.
[jQuery] Browser autocomplete posting forms.
Hello I kinda typed this text in already, but thread did not appear so im writing it again. Hopefully somebody clears up duplicate threads. $(function(){ $('input').keydown(function(e){ if (e.keyCode == 13) { $(this).parents('form').submit(); return false; } }); }); This script handles it very well, but it has some problems. Specially with browsers autocomplete. When i use this script and start typing in a value into form, then it offers complete word. When i press key down to choose it and press enter to select it, the form gets posted empty. Which blows. Is there a simple workaround to adapt with autocomplete or do i have to start counting enters - if up or down key has been pressed then 1st enter does nothing and 2nd posts the form? Alan.