Skip to content

Instantly share code, notes, and snippets.

@stefan-jonker
Created August 15, 2012 23:02
Show Gist options
  • Save stefan-jonker/3364471 to your computer and use it in GitHub Desktop.
Save stefan-jonker/3364471 to your computer and use it in GitHub Desktop.
jQuery introductie
$(document).ready(function() {
$("a[name]").css("background", "#eee" );
$("a[href*='stefanjonker']").css("color", "#FF0000");
$('#faq').find('dd').hide().end().find('dt').click(function() {
$(this).next().slideToggle();
});
});
$(document).ready(function() {
// generate markup
$("#rating").append("Please rate: ");
for ( var i = 1; i <= 5; i++ ) {
$("#rating").append("<a href='#'>" + i + "</a> ");
}
// add markup to container and apply click handlers to anchors
$("#rating a").click(function(e) {
// stop normal link click
e.preventDefault();
// send request
$.post("rate.php", {rating: $(this).html()}, function(xml) {
// format and output result
$("#rating").html(
"Thanks for rating, current average: " +
$("average", xml).text() +
", number of votes: " +
$("count", xml).text()
);
});
});
});
$(document).ready(function() {
$("#myTable").tablesorter({
// striping looking
widgets: ['zebra']
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment