WordPress.org

Ready to get started?Download WordPress

Forums

Basic Javascript Font Changer (1 post)

  1. kennethwatt
    Member
    Posted 4 years ago #

    Hi guys,

    I received this code from a friend last week, and after trying it, the 20 and 40 links don't do anything...

    http://technofinger.com/fontchanger.htm

    Any help would be much appreciated :)

    Thanks in advance,
    K

    <script language="JavaScript" type="text/javascript">
    function changeFontSize (fsize) {
    	var el = document.getElementById('content');
    	el.style.fontSize = fsize;
    }
    </script>
    <style type="text/css">
    <!--
    #header {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 24px;
    	font-weight: bold;
    	color: #000000;
    	background-color: #FFFFCC;
    	padding: 10px;
    }
    #content {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 14px;
    }
    -->
    </style>
    </head>
    <body>
    <div id="header"> Header Title </div>
    <div id="content">  <a href="#" onclick="changeFontSize(20);">20</a> <a href="#" onclick="changeFontSize(40);">40</a> <br />Content Line 1 <br />
        Content Line 1 </div>

Topic Closed

This topic has been closed to new replies.

About this Topic