Created
February 2, 2009 23:52
-
-
Save rn0/57182 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
nawigacja pomiedzy nowymi komentarzami w wykop.pl | |
*/ | |
$(document).ready(function() { | |
ids = []; | |
$('ul#wykop-comments div.comment-body-new').parent('li').each(function() { | |
ids.push($(this).attr('id')); | |
}); | |
cnt = ids.length; | |
if(cnt > 0) { | |
$('#pokaz_komentarze').before('<a href="#' + ids[0] + '">Skocz do nowego komentarza</a> | '); | |
for(i = 0; i < cnt; i++) { | |
inlineLinks = $('#'+ids[i]+' ul.inline-links'); | |
if(i >= 1) { | |
inlineLinks.append('<li><a href="#' + ids[i-1] + '">poprzedni nowy komentarz</a></li>'); | |
} | |
if((i == 0 && cnt > 1) || i < cnt - 1) { | |
inlineLinks.append('<li><a href="#' + ids[i+1] + '">nastepny nowy komentarz</a></li>'); | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment