Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6153931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:10:34+00:00 2026-05-23T20:10:34+00:00

How can it be that typeface.js doesn’t "rewrite" when you press a new href

  • 0

How can it be that typeface.js doesn’t "rewrite" when you press a new href?

If you remove typeface-js from the class it works.

Live link: http://temp.electrobeat.dk/typeface.php

updated function:

            function generate_menu(page){
                var menu = {
                    posting : {
                        title : 'Posting'
                    },
                    account : {
                        title : 'Account'
                    }
                };
                
                var elm = $('#div_menu').empty();
                for(var key in menu){
                    (function(key){
                        $('<a class="typeface-js menu '+(key == page ? 'menu_active':'')+'" href="#'+key+'">'+menu[key].title+'</a>').appendTo(elm)
                            .click(function(){
                                generate_menu(key);
                            });
                    })(key);
                }
                _typeface_js.initialize();
            };

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
 "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
        
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js" type="text/javascript"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js" type="text/javascript"></script>
        
        <script src="typeface-0.15.js" type="text/javascript"></script>
        <script src="arial_bold.typeface.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                function generate_menu(page){
                    var menu = {
                        posting : {
                            title : 'Posting'
                        },
                        account : {
                            title : 'Account'
                        }
                    };
                    
                    var elm = $('#div_menu').empty();
                    for(var key in menu){
                        (function(key){
                            $('<a class="typeface-js menu '+(key == page ? 'menu_active':'')+'" href="#'+key+'">'+menu[key].title+'</a>').appendTo(elm)
                                .click(function(){
                                    generate_menu(key);
                                });
                        })(key);
                    }
                };
                
                generate_menu('posting');
            });
        </script>
        
        <style type="text/css">
            #div_menu {
                background:#ff0000;
                padding:5px;
            }
            
            .menu {
                font-family:arial;
                font-size:14px;
                color:#e8f5ff;
                font-weight:bold;
                border-bottom:3px solid transparent;
                text-decoration:none;
                padding:1px 2px 2px 2px;
                margin:0px 2px 0px 2px;
            }
            
            .menu_active {
                color:#07447c;
                border-bottom:3px solid #e8f5ff;
            }
        </style>
    </head>
    
    <body>
        <div id="div_menu"></div>
    </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:10:35+00:00Added an answer on May 23, 2026 at 8:10 pm

    The problem is that you’re removing the elements and then adding them again, but typeface.js only runs once on the page. If you are doing this you need to manually retrigger typeface.js’s method, which might be:

    _typeface_js.initialize(); 
    

    Put this (or whichever method it turns out to be) in your generate_menu method after attaching the elements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that fonts properties can be found in the TypeFace class but I
i write some utility class but how to get name ? Can that send
Can anyone point to libraries that can be used for Printing from Compact .Net
Can I create a private instance method that can be called by a class
I'm new to MVC. You have been warned... I have User model that can
I want to use regions for code folding in Eclipse ; how can that
Anyone that can help me out will be very much appreciated. I seem to
I can understand that imposing a minimum length on passwords makes a lot of
I can do that file-by-file with Save As Encoding in Visual Studio, but I'd
Can you recommend a library for .NET that can receive FAXes? Window Fax server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.