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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>This is a Sample Page</title> | |
<link href="allstateni-1.0.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> | |
<h1>Truncate Example</h1> |
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
(function ($) { | |
$.fn.truncate = function (options) { | |
var defaults = { | |
length: 300, | |
minTrail: 20, | |
moreText: "more", | |
lessText: "less", | |
ellipsisText: "..." | |
}; |
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
p { | |
width:600px; | |
background-color:#ccc; | |
padding:10px; | |
} | |
.allstateni_normal_text { | |
font-size: .85em; | |
font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif; |
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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>This is a Sample Page</title> | |
</head> | |
<body> | |
<h1>Truncate Example</h1> | |
<p class="truncate"> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Rock Paper Scissors basic version</title> | |
</head> | |
<body> | |
</body> | |
</html> |
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
<p> | |
<span>The human has chosen:</span><br /><br /> | |
<input type="radio" name="human-choice" value="rock">Rock<br /> | |
<input type="radio" name="human-choice" value="paper">Paper<br /> | |
<input type="radio" name="human-choice" value="scissors">Scissors<br /><br /> | |
<input type="button" id="play-game" value="Play" /><br /><br /> | |
</p> | |
<p> | |
The computer has chosen: <i><span id="computer-choice"></span></i> |
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
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<script type="text/javascript"> | |
</script> |
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
var choiceArray = ['rock', 'paper', 'scissors']; | |
var humanChoice = ''; | |
var computerChoice = ''; | |
var winner = ''; | |
$('#play-game').click(function() { | |
computerChoice = choiceArray[Math.floor(Math.random() * choiceArray.length)]; | |
humanChoice = $('input:radio[name=human-choice]:checked').val(); |
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
function theWinnerIs(humanChoice, computerChoice) { | |
if (humanChoice === computerChoice ) { | |
return 'no winner it is a draw'; | |
} | |
if ((humanChoice === 'rock') && (computerChoice === 'scissors')) { | |
return 'human'; | |
} | |
if ((humanChoice === 'rock') && (computerChoice === 'paper')) { |
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
equal: function( actual, expected, message ) { | |
/*jshint eqeqeq:false */ | |
QUnit.push( expected == actual, actual, expected, message ); | |
}, | |
push: function( result, actual, expected, message ) { | |
if ( !config.current ) { | |
throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); | |
} |
OlderNewer