[jQuery] Re: Newbie Question: Finding and manipulating an element

2010-03-02 Thread Greg Tarnoff
Aaron, Not sure if you caught it, but I screwed up some quotes in my code snippet (stupid iphone). It should be: $('ul.foo li ul').addClass("bar"); On Mar 1, 9:25 am, Aaron Johnson wrote: > Greg, Nathan, Thanks very much for your help! > > On 1 March 2010 14:58, Nathan Klatt wrote: > > > On M

[jQuery] Re: Newbie Question: Finding and manipulating an element

2010-03-01 Thread Greg Tarnoff
This will add the class for you. Put it in the document ready function if you want it on page load or in whatever function you want to call it from. $('ul.foo li 'ul").addClass("bar"); On Mar 1, 5:06 am, Aaron Johnson wrote: > Hello... > > I have an unordered list containing nested lists... > >

[jQuery] Re: how to get href value

2010-01-23 Thread Greg Tarnoff
t does a single if > statement asking "was this a link?" > > On Jan 23, 10:52 am, Amos King wrote: > > > > > Greg, I'm not sure how your's is much diffrent then the original. > > > On Sat, Jan 23, 2010 at 7:04 AM, Greg Tarnoff wrote: > >

[jQuery] Re: how to get href value

2010-01-23 Thread Greg Tarnoff
Actually all of these are slow. The last example will run anytime you click the page. You only want to run this if they click an A element. So attach a click event to A. Try this: $(document).ready(function(){ $('a').click(function(){ alert($(this).attr('href');); }); }); only do the e.preven

[jQuery] Re: tabs in one line, on small resolution

2010-01-13 Thread Greg Tarnoff
Another option is using the CSS min-width to set a minimum width in case they make the window smaller, this will prevent the block from wrapping.. this will mean two things: 1) Side scrolling in 800x600, but let's be real you shouldn't have to support that these days anyway. 2) Min-width does

[jQuery] Re: Lessons learned with sliding menus and lightbox

2009-12-19 Thread Greg Tarnoff
Erik, Nice of you to post this lesson for others, but I hate to say you could have saved yourself lots of time with one simple line of code. jquery.noConflict(); http://docs.jquery.com/Core/jQuery.noConflict This gives control of the $ namespace back to whichever library calls it. By loading m

[jQuery] Re: NEED HELP::siblings isssue in jquery

2009-12-10 Thread Greg Tarnoff
Easier yet, give your UL an ID then $('#myID li a').click(function() { $('#myID li a').removeClass("bg"); $(this).addClass("bg"); }); --Greg

[jQuery] Re: 508 accessibility for tabs

2009-12-09 Thread Greg Tarnoff
First, don't use a # as your href instead put #yoursectionID. This will give the A element an automatic click to the ID it is tied to if the JS is turned off (likely the case if screen reader is in use). Next read this: http://www.w3.org/WAI/intro/aria. JAWS 10+ supports aria, or Advanced Rich Int

[jQuery] Re: Opacity for background, but not for the element inside

2009-12-07 Thread Greg Tarnoff
Sorry, I should have been more clear. Setting work to .6 and the children to 1 won't work. The children then become 100% of their parent. Also opacity can't be set beyond 100%, so you can't go 1.4. I have tried all of these before in previous projects with absolute fail. That being said, other co

[jQuery] Re: Opacity for background, but not for the element inside

2009-12-06 Thread Greg Tarnoff
The problem is in the way browsers render opacity. The spec reads that only the element and not children should have the reduced opacity, however none of the browsers have implemented this at last check (maybe safari 4+). Your best bet is to apply a background image with the designated opacity as

[jQuery] Re: Functions

2009-11-17 Thread Greg Tarnoff
You are kind of defeating the purpose of Jquery if you put the call to the function in an A element. Does the parent of the A element in question have an ID? You could then call $('parent a'). If there is more than one A in there you can target it with other selectors (http://docs.jquery.com/Select

[jQuery] Re: Konami Code >:]

2009-11-17 Thread Greg Tarnoff
Love it, although I had to make some modifications to get it to work. Your function without the {} brackets didn't run, also add in the key '13' as this is the enter key (aka start). [code] $(function (){ var press = 0, keys = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13]; $(document).keydown(