[jQuery] next() and prev()
I'm stuck using next() and prev() The menu on right hand side of this site: http://sugarsnap.previewurl.net needs to scroll through each item as the user clicks the arrows. This is working but only because I've put fixed heights to scroll - which is buggy cross browser., hence wanting to use next() and prev() the code that works: $('a.down').click(function(event) { $('#folioMenu').scrollTo('+=90px', 800); return false; }); I tried this , and several variations, wiht no luck: $('#folioMenu').scrollTo($(".menuItem").next(), 800); any thoughts as to how this could be achieved?
[jQuery] scrolling menu items...
Hello, I've got this working but its "hard coded". the menu on right hand side of this site: http://sugarsnap.previewurl.net needs to scroll through each item as the user clicks the arrows. This is working but only because I've put fixed heights to scroll - shich is buggy cross browser. the code: $('a.down').click(function(event) { $('#folioMenu').scrollTo('+=90px', 800); return false; }); I want to use next and prev but it didnt work: $('#folioMenu').scrollTo($(".menuItem").next(), 800); I've tried several variations but no luck. any thoughts as to how this could be achieved?
[jQuery] Background image position?!
I have a pop up div on our sites home page. The content changes based on the menu link the user clicked. A triangle tab should then move to reside between the clicked menu item and the popUp. This works fine of the dev server, but not on our live server (http:// www.pro-bel.co.uk/) We've checked: 1 - The jQuery.js files and tried re-uploading the latest version, both compact and normal. 2 - My scripts are the same on both servers. 3 - Both sites are on the same server though, just a difference domain?! To see the problem go to the live site: http://www.pro-bel.co.uk/ and click on Routing & Control then Automation and Media Management then Master Control. The blue triangle moves on the dev server to match the position of the clicked link. My Code: $('div#solutions a.popUp').click(function(event) { event.preventDefault(); /* Position tag */ var myPos = $(this).position(); var popup = $('#solutionTool'); // 327 is the Y position of the UL // 24 is the aprox height of the li item var myY = (myPos.top - 327 + 24) + 'px'; $('#solutionTool').css("backgroundPosition", "0px " + myY + "px"); return false; });
[jQuery] Re: A better way to animate this list..?
Cheers Guys, a great help!!
[jQuery] Re: Get element by class based on document.location variable
I fixed it: $("." + currentSection).next().slideDown(500); missed the next() I guess I need aa break! On Sep 23, 6:27 pm, PaulC <[EMAIL PROTECTED]> wrote: > I have a set of lists with child elements – these are my navigation. > Each top level list item a has a class that corresponds to a given > section. > > The child elements are hidden by default. I want a correct child list > to open based on the URL you are visiting. > > The code I have is as follows: > > var currentSection = document.location.toString().split('/')[4]; > > I then want the list item with the matching class to the var > currentSection to slide open. I thought it was this: > $("." + currentSection).slideDown(500); > > But it doesn’t work!
[jQuery] Get element by class based on document.location variable
I have a set of lists with child elements – these are my navigation. Each top level list item a has a class that corresponds to a given section. The child elements are hidden by default. I want a correct child list to open based on the URL you are visiting. The code I have is as follows: var currentSection = document.location.toString().split('/')[4]; I then want the list item with the matching class to the var currentSection to slide open. I thought it was this: $("." + currentSection).slideDown(500); But it doesn’t work!
[jQuery] A better way to animate this list..?
I'm new to jQuery so be gentle!! I have a menu list, and I want each li to fade in one at a time, I can do this with the following code: $("ul.menu li:first-child").fadeIn(1000, function () { $(this).next().fadeIn(1000, function () { $(this).next().fadeIn(1000, function () { $(this).next().fadeIn(1000, function () { $(this).next().fadeIn(1000, function () { $(this).next().fadeIn(1000, function (){ $(this).next().fadeIn(1000, function (){ $(this).next().fadeIn(1000); }) }); }); }); }); }); }); As you can see its not nice! I'm sure there is a better way, especially as the menu is dynamic so I'd never know how many items there are. Any help or advice is appreciated.