12345678910111213141516171819202122232425262728293031 |
- $(document).ready(function() {
- var $speech = $('div.speech');
- var defaultSize = $speech.css('fontSize');
- $('#switcher button').click(function() {
- var num = parseFloat($speech.css('fontSize'));
- switch (this.id) {
- case 'switcher-large':
- num *= 1.4;
- break;
- case 'switcher-small':
- num /= 1.4;
- break;
- default:
- num = parseFloat(defaultSize);
- }
- $speech.css('fontSize', num + 'px');
- });
- var $firstPara = $('p').eq(1);
- $firstPara.hide();
- $('a.more').click(function(event) {
- event.preventDefault();
- if ($firstPara.is(':hidden')) {
- $firstPara.fadeIn('slow');
- $(this).text('read less');
- } else {
- $firstPara.fadeOut('slow');
- $(this).text('read more');
- }
- });
- });
|