1 $(document).ready(function() {
2 //catch the right-click context menu
3 $(document).bind("contextmenu",function(e) {
4 //warning prompt - optional
5 alert("No right-clicking!");
6
7 //delete the default context menu
8 return false;
9 });
10 });
$(document).ready(function() {
//find the current font size
var originalFontSize = $(‘html‘).css(‘font-size‘);
//Increase the text size
$(".increaseFont").click(function() {
var currentFontSize = $(‘html‘).css(‘font-size‘);
var currentFontSizeNumber = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNumber*1.2;
$(‘html‘).css(‘font-size‘, newFontSize);
return false;
});
//Decrease the Text Size
$(".decreaseFont").click(function() {
var currentFontSize = $(‘html‘).css(‘font-size‘);
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*0.8;
$(‘html‘).css(‘font-size‘, newFontSize);
return false;
});
// Reset Font Size
$(".resetFont").click(function(){
$(‘html‘).css(‘font-size‘, originalFontSize);
});
});
1 $(document).ready(function() {
2 //select all anchor tags that have http in the href
3 //and apply the target=_blank
4 $("a[href^=‘http‘]").attr(‘target‘,‘_blank‘);
5 });
1 $(document).ready(function() {
2 $("a.cssSwap").click(function() {
3 //swap the link rel attribute with the value in the rel
4 $(‘link[rel=stylesheet]‘).attr(‘href‘ , $(this).attr(‘rel‘));
5 });
6 });
1 $(document).ready(function() {
2 //when the id="top" link is clicked
3 $(‘#top‘).click(function() {
4 //scoll the page back to the top
5 $(document).scrollTo(0,500);
6 }
7 });