To explain a little more: When I move from one navigational element to
the next the animation restarts, I was wondering if there was a way I
could stop this happening so that the sub-nav stays down, until I move
off the navigation completely or a navigational element which doesn't
activate the sub-nav. I did manage to achieve this by making two divs
above and below and beside the navigation bar and then setting a
jQuery function like this:
$("#div1, #div2, #nav_off").hover(function() {
                $("#sub_nav").slideUp(200);
                $("#wrap").animate ({ 'marginTop' : '30px' }, 200);
});

However I concluded that it was a little too unsemantic and that there
must be a better way of achieving my goal, if there isn't then I guess
I'm going to have to go with that method.

By the way I've altered the jQuery code so it works with the following
plugin http://blog.threedubmedia.com/2008/08/eventspecialhover.html.
Just so the sub-nav doesn't go off if the user just quickly moves over
the navigation without the intention of actually clicking it.

I've uploaded the site here http://tutshelf.com/TutShelf_Beta/

You can find links to sourcefiles in the source code, but if your lazy
just got to here: http://tutshelf.com/TutShelf_Beta/js/stuff.js and
for the CSS here: http://tutshelf.com/TutShelf_Beta/style.css

I couldn't get the code to work with JSBin, sorry :(



On Jul 23, 1:59 pm, Charlie <charlie...@gmail.com> wrote:
> idea of "freezing" jQuery not making a lot of sense. What you did to post 
> code is great, however there's an even better way, put it in jsBin. jSBin 
> will include jQuery for you and give a working copy of your code to share, 
> instead of it being in 2 places with no CSS.
> Perhaps if you explained the problem as it relates to menu instead of freeze 
> jQuery would help. Other than that will simply hiding the subs instead of 
> timed slideUp help?
> alexrogahn wrote:Hi, I created a sub-navigation menu for a site I've been 
> working on and the thing works perfectly in my opinion... well, near 
> perfectly. When I move my mouse from one main navigation link to the other, 
> the .slideUp and .slideDown properties still work, which is annoying because 
> your essentially having to wait to use the sub-navigation again, even if it 
> is only a few milliseconds. I was wondering if there was a way I could 
> "freeze" the jQuery until I moved off the (for lack of a better description) 
> links that activate the sub-nav. Below is links to my code: 
> HTML:http://tinypaste.com/98d643cjQuery:http://tinypaste.com/0b05837

Reply via email to