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 8125513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:50:38+00:00 2026-06-06T06:50:38+00:00

https://auth.me.com/authenticate On this website when you type in your email address , the font-size

  • 0

https://auth.me.com/authenticate

On this website when you type in your email address , the font-size will automatically be reduced if the email address fills the box size.

enter image description here

enter image description here

enter image description here

  • How can we do the same using Javascript?

  • which are the events that are being fired / captured ?

  • 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-06-06T06:50:40+00:00Added an answer on June 6, 2026 at 6:50 am

    I have made a library, named resize.js, which allow to write:

    <input type="text" resize="true" />
    

    This is the library:

    var precision=18;
    
    window.onload=function()
    {
        for(var i=0,t=document.getElementsByTagName("input"),l=t.length;i<l;i++)if(t[i].getAttribute("resize")==="true")
        {
            var div=document.createElement("div");
            div.setAttribute("style","font-size"+parseInt(t[i].s("font-size"))+";font-family:"+t[i].s("font-family")+";position:absolute;top:-10000px;left:-10000px;");
            document.body.appendChild(div);
            (function(i,div,min,max,dif,l,r,w,h,pre){setInterval(function(){modify(t[i],div,min,max,dif,l,r,w,h,pre);},100);})
            (
                i,
                div,
                t[i].getAttribute("min")||parseInt(t[i].s("font-size"))-3,
                t[i].getAttribute("max")||parseInt(t[i].s("font-size")),
                parseInt(t[i].s("padding-left"))+parseInt(t[i].s("padding-right"))+parseInt(t[i].s("border-left-width"))+parseInt(t[i].s("border-right-width"))+precision,
                parseInt(t[i].s("padding-left")),
                parseInt(t[i].s("padding-right")),
                t[i].offsetWidth,
                t[i].offsetHeight,
                precision
            );
        }
    }
    Object.prototype.s=function(p)
    {
        return this.currentStyle?this.currentStyle[p]:document.defaultView.getComputedStyle(this,null).getPropertyValue(p);
    }
    function modify(el,c,min,max,dif,l,r,w,h,pre)
    {
        el.style.width=w+"px";
        el.style.height=h+"px";
        c.innerHTML=el.value.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/ /g,"&nbsp");
        var test=c.offsetWidth;
        while(test>=el.offsetWidth-dif&&parseInt(el.s("font-size"))>min)
        {
            el.style.fontSize=parseInt(el.s("font-size"))-1+"px";
            c.style.fontSize=el.style.fontSize;
            test=c.offsetWidth;
        }
        while(test<el.offsetWidth-dif&&parseInt(el.s("font-size"))<max)
        {
            el.style.fontSize=parseInt(el.s("font-size"))+1+"px";
            c.style.fontSize=el.style.fontSize;
            test=c.offsetWidth;
        }
        if(parseInt(el.s("font-size"))===min&&c.offsetWidth>el.offsetWidth-dif)
        {
            el.style.paddingLeft="0px";
            el.style.paddingRight="0px";
        }
        else
        {
            el.style.paddingLeft=l+"px";
            el.style.paddingRight=r+"px";
        }
    }
    

    A fiddle: http://jsfiddle.net/mageek/GEp2y/1


    Some advices:

    • If the attribute “resize” equals anything other than true, or is not set, the text-box will behave as a normal text-box.
    • You can set the maximum font-size and the minimum font-size allowed by setting the “max” and the “min” attributes. By default, the maximum is the current font-size and the minimum is 3 sizes smaller than the maximum.
    • I added something, like https://auth.me.com/authenticate, which removes the padding to gain space when the minimum font-size is reached.
    • There is the variable ‘precision’ (at the beginning of resize.js) that depends on the text-box, I set it to 18 for default text-box but if you modify the style of the text-box, you will maybe have to modify the variable to a better value (by testing).
    • I don’t ensure the host of resize.js on the website like in the fiddle, you should copy the source code in a new file and save it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently redirecting to this: https://graph.facebook.com/oauth/authorize?client_id=305384546164461&redirect_uri=http://www.eeisi.com/bridge/auth.php&type=web_server&display=page&scope=publish_stream,%20user_about_me,%20user_likes,%20email I have no idea why I am
I used curl to query Facebook's FQL and this happened: > curl 'https://api.facebook.com/method/fql.query' -d
I just came across this code in the HTTP Auth library of the Zend
I'm new to cakephp and following this tutorial. http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html I have created the blog
I'm trying to authenticate with a server over HTTPS. I'm having problems with the
QUESTION Which of the Youtube Data API auth methods will allow me to upload
I am trying to use this railscast episode to provide authentication via twitter http://railscasts.com/episodes/235-omniauth-part-1
I'm experiencing the same problem in this previous stackoverflow.com post . Specifically, I seem
A quickie, and hopefully an easy one. I'm following the docs at http://docs.djangoproject.com/en/dev/topics/auth/ to
I am doing basic http auth with the HttpURLConnection object in Java. URL urlUse

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.