JQuery Toggle Hide and Show Link

Even if you’re new to JQuery it’s always mind-boggling how easy it is to do pretty cool UX stuff with it.

Here’s you you make a link that shows and hides content on you page:

$("#toggle_link").toggle(
function() {
$(".extra_info_text").show("fast");
$("#toggle_link").text("Hide Extra Info");
},
function() {
$(".extra_info_text").hide("fast");
$("#toggle_link").text("Show Extra Info");
}
);

Give you link the id of "toggle_link" and the text you want to hide the class of "extra_info_text." Pretty darn easy.

Uncategorized

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

One Response to “JQuery Toggle Hide and Show Link”

Leave Comment

(required)

(required)