A friend of mine emailed me that he scored a 21 out of 107 on the full list of Stuff White People Like. I thought it was a little tedious to count, so I wrote up a small script which counts it up for you via the checks you make. Below the fold….
.wholeRapper { padding:10px; }
.whiteThings { padding:5px; padding-right:10px; padding-bottom: 10px; float:left; clear: none;}
#outPutBox { padding:20px; clear:both; font-size:36px; font-style:italic;}
#totalWhite {background-color:#CCCCCC; width:400px; padding:20px;}
function toteUp()
{
var totNum = 0;
var formElementsNum = document.form.length;
a = 0;
while ( a < formElementsNum )
{
if (document.form.elements[a].checked == true)
{
totNum++;
} // end if
a++;
}// end while
document.getElementById("totalWhite").innerHTML = totNum + " out of 107 Stuffs White People Like
“;
imageChange(totNum);
}// end function
function imageChange(totNum)
{
if (totNum == 107)
{
document[‘headShot’].src=’http://scienceblogs.com/gnxp/107.jpg’;
window.open(‘http://www.sierraclub.org/’,’youraresowhite’,’width=600,height=600′);
}
else if (totNum > 99)
{
document[‘headShot’].src=’http://scienceblogs.com/gnxp/100.jpg’;
}
else if (totNum > 79)
{
document[‘headShot’].src=’http://scienceblogs.com/gnxp/80.jpg’;
}
else if (totNum > 59)
{
document[‘headShot’].src=’http://scienceblogs.com/gnxp/60.jpg’;
}
else if (totNum > 39)
{
document[‘headShot’].src=’http://scienceblogs.com/gnxp/40.jpg’;
}
else if (totNum > 19)
{
document[‘headShot’].src=’http://scienceblogs.com/gnxp/20.jpg’;
}
else
{
document[‘headShot’].src=’http://scienceblogs.com/gnxp/0.jpg’;
}
}// end function
onLoad = toteUp();

Comments are closed.