So I have this text field that is too large to show, but you want a button that will display the rest:
<div class="span4" >
some description..
<div class="hidden-text" style="display:none">
rest of description<br/>
</div>
<a href="#" class="btn" id="readmore"><i class="icon-chevron-up"></i> Read more</a>
<script>
$("#readmore").click(function(){
$('#hidden-text').attr('style', '');
});
</script>
</div>
Why does this not work and how should it be done?
EDIT:
Thanks for the demo, unfortunately I can't replicate it
<div class="span4" >
some description..
<style>
.hidden-text {
display:none;
}
</style>
<p class="hidden-text">rest of description<br/></p>
<br/><br/>
<a href="#" class="btn" id="readmore"><i class="icon-chevron-down"></i> Read more</a>
<script>
$(document).ready(function(){
$('.readmore').on('click', function(){
$('.hidden-text').slideDown('slow');
});
});
</script>
</div>
I don't see what is so different from the demo...