Created
August 15, 2012 23:02
-
-
Save stefan-jonker/3364471 to your computer and use it in GitHub Desktop.
jQuery introductie
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
$(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