Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="jquery-1.4.3.min.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript" charset="utf-8">
- $(function(){
- $('a').click(function(){
- var os = $('p').css('font-size');
- var num = parseFloat(os, 10);
- var uom = os.slice(-2)
- $('p').css('font-size', num / 1.4 + uom);
- if(this.id == 'larger'){
- $('p').css('font-size', num * 1.4 + uom);
- }
- })
- });
- </script>
- </head>
- <body>
- <a href="#" id="larger">Larger</a> <br />
- <a href="#" id="smaller" />Smaller</a>
- <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
- </body>
- </html>
Add Comment
Please, Sign In to add comment