The link to hide text works, but the link to .show the hidden text doesn’t show it and I don’t see any errors. See jsfiddle at: http://jsfiddle.net/tv6WQ/
<head>
<style type="text/css">
#shortandlong {color:red}
#thestory {visibility:hidden}
</style>
</head>
<body>
<span id="shortandlong">This is the short version but click </span><a href="#" id="showme">here...</a><span id="thestory"> now this is the full version</span><br/>
<span id="hideit">This text can be hidden </span>by clicking here <a href="#" id="hideme">here</a><br/>
</body>
js:
$(document).ready(function ()
{ $('#hideme').click(function()
{ $('#hideit').hide('fast');
return false; } );
$("#showme").click(function()
{ $('#thestory').show;
alert('Hello World');
return false; } );
} );
Two things:
show()is a function so you need parentheseshide/showchange thedisplayproperty, not the visibility – so change$('#thestory').showto$('#thestory').css('visibility','visible')