Reputation: 1478
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; } );
} );
Upvotes: 0
Views: 1199
Reputation: 42139
Two things:
show()
is a function so you need parentheses hide/show
change the display
property, not the visibility - so change $('#thestory').show
to $('#thestory').css('visibility','visible')
Upvotes: 1
Reputation: 1183
Your aren't calling the method. Add parenthesis after. E.g. .show();
Upvotes: 0
Reputation: 255005
.1.
$('#thestory').show()
not
$('#thestory').show
.2. Replace visibility:hidden
with display: none;
or change the visibility by $('#thestory').css('visibility', 'visible');
Upvotes: 3
Reputation: 60574
You have a typo, it should be show()
in
$("#showme").click(function()
{ $('#thestory').show;
Upvotes: 0