Profile
Achievement
dougunderscorenelson's Recent SnippetsTagged jquery
- All /
« Prev 1 Next »
Sometimes you click a link like faq.html#item5 and, after the browser jumps you to the anchor, you have trouble spotting the item you're looking for. anchorAway is a little function that helps you call a function on anchored items, maybe something li...
0
702
posted 15 years ago by dougunderscorenelson
Used this on a project to determine whether images were loaded or not. In an image carousel, for example, you could test the next/clicked image before advancing the slide, and if 'loaded' wasn't 'true', you could add a "loading" class and attach a ne...
3
648
posted 15 years ago by dougunderscorenelson
Quickly get the index of the current element. I find myself re-using this several times in a document, so I made a lil' function for it.
3
1274
posted 15 years ago by dougunderscorenelson
HRs are a pain in the ass to style, so why bother? Wrap them in a DIV with a class of HR instead. (In your stylesheet, set .hr hr { display: none }).
This also ports the class of the HR up to the new parent DIV, allowing you to make a few differen...
1
592
posted 15 years ago by dougunderscorenelson
This adds a class to focused form elements (helpful for IE6/7), as well as adds a class to the input's parent (in this case, named "form-field").
1
772
posted 15 years ago by dougunderscorenelson
Quick script to find button elements (and elements with the "button" class) and wrap their innards in spans. Good for making rounded-corner buttons.
0
609
posted 15 years ago by dougunderscorenelson