Skip to content

Instantly share code, notes, and snippets.

View benjskim's full-sized avatar

Ben benjskim

  • Los Angeles, CA
View GitHub Profile
@benjskim
benjskim / gist:6999177
Created October 15, 2013 21:46
When I click on ".moreabout" the text successfully changes to "Read Less" but not vice-versa
$(".moreabout").click(function(){
$(".moreabouttext").slideToggle();
if ($(".moreabout").css("display") == "none") {
$(".moreabout").text("Read More");
}
else {
$(".moreabout").text("Read Less");
}
});
$(function() {
$(".moreabout").click(function(){
if ($(".moreabout").text() == "Read More")
{
$(".moreabout").text("Read Less");
} else
{
$(".moreabout").text("Read More");
}
$(".moreabouttext").slideToggle();