Created
December 16, 2009 10:05
-
-
Save cgallagher/257724 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
$("#prev ~ sibling) doesnt seem to work in IE7 if the type both the prev and sibling element are of the same type. The examples on jQuery.com dont point this out. | |
(http://docs.jquery.com/Selectors/siblings#prevsiblings) | |
below is a workaround. | |
*/ | |
var items = selectElsAfter(yourSelector); | |
$(items).each(function() | |
{ | |
//do something to the selected elements in here... whatever the hell you like! | |
}); | |
function selectElsAfter(el) | |
{ | |
var els = [] | |
element = $('#'+el); | |
var index = ($('*',element.parent()).index(element)); | |
for(i=(index+1);i<$('*', element .parent()).length;i++) | |
{ | |
els.push($($('*', element.parent()).get(i))); | |
} | |
return els; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment