Restoring a saved text size

Hello

I have a smartphone application that allows the user to change the size of the characters and it works correctly. I would like the app to store the new font size and restore the next time that the application is open, and I'm having difficulties with this. Changed font size is correctly stored in local storage and retrieved when the application is reloaded, but I can't seem to change the display of the font size.

The section of js below is the ready function of doc. It tests if the user has changed the text size the last time and if yes to restore the size of the text. The first alert poster correctly stored text size and the second shows that the default size is used. I must be missing something blinding... sigh.

If stored, get the size of the previous text

If (localStorage.size)

{var saveSize = localStorage.size;}

Alert ("stored size =" + saveSize); This shows say 20px

$('div').css ('font-size', saveSize);

var setSize = $('div').css ('font-size');

Alert ("setSize =" + setSize);  This shows 14px

}

Thanks for any direction you can provide.

Tony

Nevermind I figured it. In case it helps someone else the problem was that I forgot the units when I resized the fonts. The line

$('div').css ('font-size', saveSize);

should have been

$('div').css ('font-size', saveSize + 'px');

Problem solved.

Tags: Dreamweaver

Similar Questions

  • I want to restore the size of normal printing for everything on my computer. I tried using the page (text size) and it did nothing, can you help me?

    text size problem

    I'm not sure what means 'normal' - I assume that means you had recently but has changed.  Do a system restore to a point at the time the text was the right size and format you want - BEFORE it changed to what you don't want.  Here is the procedure: http://www.howtogeek.com/howto/windows-vista/using-windows-vista-system-restore/.  Don't forget to check the box to show more than 5 days worth of restore points.  If this does not work at first, try a previous restore point or two.  NOTE: You will need to re - install any software or updates installed between now and the point of restoration - but you can make updates through Windows Update.

    As an alternative, you can go to start / Control Panel / customization / display settings / and set the resolution to a different setting.  Click on apply, and it will ask you if you really want to change based on what you see now.  Click on your answer and either output or try another setting.  It is a more difficult way to do a system restore because it is difficult to choose the same size you had before.

    Good luck and I hope this helps. Lorien - a - MCSE/MCSA/network + / A +.

  • Restore accidentally deleted text to a previously recorded message Hotmail

    I just accidentally deleted most of the text of an e-mail message Hotmail that I am writing.  I had saved the message several times before deleting the text.  I can restore the deleted text?

    Thank you.

    Hello

    I suggest you according to the question in this forum and check if that helps:

    http://windowslivehelp.com/forums.aspx?ProductID=1

    It will be useful.

  • text size went from 100% to 115% - why?

    When my pc opens a web page, the text size is now about 120%. What happened over-nite. How can I solve this problem?

    The Web page zoom is set to 100%. Could be a monitor problem? I had to have the center of the screen page, but the slightly enlarged page persists. The moniter is a flat screen DEll 'se198wfp.

    What of the % sign to the status bar? You say 120%?

    If so, click on it and change it back.

    > It happened to over-nite.

    In this case, do a system restore. Choose a date where you did not have this problem as yout restore point.

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    I don't know exactly what happened to you.

    The above tips are the best I can do.

  • Text size problem

    I changed the size of the text... I randomly chose a size and then had to shut down to see how it would be on screen
    Well... It's too big... so now when I go back to change the size... page is too big to go down to 'apply' 'ok'... so cannot click on it
    Have tried to change the resolution to make the smaller stuff maybe?... but the same thing... page at large to scroll down to click "apply" "ok."
    Have removed the bottom bar of the screen to give more room... but not enough
    Tried to restore but has not changed the text size on reboot
    Any suggestions?
    The pointer is about 3/4 inches of fat!
    Same still gmail text size
    As you can tell... I am VERY UN 'tech '.
    Yo thanks for your time

    Hello

    you use the TAB key to navigate to a window

    then you use the ENTER key to OK, etc.

    http://Windows.Microsoft.com/en-us/Windows-Vista/change-screen-resolution

    Change the screen resolution

  • How to make the default text size and line spacing in small Sticky Notes?

    How to make the default text size and line spacing in small Sticky Notes

    Hello

    I suggest that you try the method below and check if it helps.

    Method 1: analysis of auditor of file system (CFS)

    System File Checker is a Windows utility that allows users to find corruptions in Windows system files and restore the damaged files. To perform a scan of the SFC, check out the link: https://support.microsoft.com/en-us/kb/929833.

    Note: the steps for Windows 8/8.1, works perfectly with Windows 10.

    Method 2: clean boot

    A clean boot is executed to start Windows by using a minimal set of drivers and startup programs. This will eliminate software conflicts that occur when you install a program, an update or when you run a program in Windows. Follow the link to perform the clean boot: https://support.microsoft.com/en-us/kb/929135.

    Kind regards

    Angelo bar

    Microsoft community

  • BlackBerry Smartphones location of saved Text messages and downloads please as a desire to update the device software

    I have a Blackberry 9300. I noticed while testing option 'restore' in Blackberry Desktop Software 'Saved messages' is grey so not able to restore and downloaded programs were not included in the backup course so I'm delaying the update of the OS 6 bundle OS 6 bundle 1879 2949 until I can get these issues resolved. First of all, where are my saved text messages would be they located on the SD card? Secondly, where are the downloaded applications and how would bring him back, I should reinstall individually or is there a better method I guess updating the software of the device would eliminate any reference to them? Thanks in advance, Marcia

    willismc wrote:
    My problem, I think that will be most of the downloads and installations have been from the Blackberry web, although "My World" lists apps, I have only the option to remove and reinstall yet if I so choose. That's why I need to dig a little deeper on the aspect of the place here.

    To reinstall your applications, see this KB:

    • KB17625 How to install or transfer has already purchased apps from BlackBerry App World for BlackBerry smartphone

    You may also need to clear the cache of application AppWorld:

    1. open the App World

    2. go to my world

    3. follow one (and only one!) of these steps:

    3. for the BB keyboard-oriented - hold down the ALT key and press on, in the sequence R, then S, then T

    3B. for touch screen only BBs - hold the num-lock (! 123 button) so that it hangs and then press on, in the sequence 3, then 4, then)

    3 c for the most recent (e, g., OS6 and 7) BB s, see this KB:

    • KB24714 How to clear the cache of BlackBerry App World

    4 AppWorld must close

    5. If your BB locks after issuing clear cache, do a battery pull reboot

    6. return to AppWorld/MyWorld (it can be slow, while it re - sync).

    If (4) stage arrives not as described, then the empty the cache failed.

    willismc wrote:
    I was also interested to read your information on the primary database of smartphone that made me wonder if it was at this location that the saved text messages were built. I mention this as I save some of my text messages I can consult at any time by selecting 'View the Messages stored' in the menu messages text, which lists the emails and text messages, that you saved.

    The Interface of Messages is against the databases on the BB... Watch a saved messages can be as simple as a filter that is applied to display only those, but always from the same database. Also understand that the 'Messages' is a term Super set, with "email", "SMS", and other types of messages into subsets.

    willismc wrote:
    Saving messages electronic elsewhere are not a problem but saved SMS backup does not seem to be an option, why would I need to check this feature before upgrading the device software. Appreciate your answer to that one.

    As I said, I suspect saved SMS Messages to be a subset of the base of great set 'SMS Messages"together with the message 'saved' being a subset within this database.

    I can't answer definitively for you because I've never had the problem you are experiencing. You may need to test to know for sure.

    Good luck!

  • Text size

    How to restore the size of my text that has shrunk? view and clicking on text size and plu does not

    Hello

    If you are referring to the size of the text in a web browser, you can use the following commands.

    Hold down the CTRL key and press - (less) to reduce the size of the page.

    Hold down the CTRL key and press + (Plus) to increase the size of the page.

    Press and hold Ctrl and press 0 (zero) to return to the default size.

    Kind regards

    DP - K

  • is there anyway to restore the deleted text messages?

    is there anyway to restore the deleted text messages?

    balhblah wrote:

    is there anyway to restore the deleted text messages?

    Yes, you restore them by restoring your phone to your iTunes or icloud backup, as text message is part of the backup.

    If you don't back upwards - so no you can't restore the.

  • Slate 7: common and other: too small text size

    When you use the "common" applications and during exploration down in an article, it cannot be read as the text size is too small. It cannot be expanded. (same behavior for example, OneNote apps). The mentioned applications work fine on my Samsung tab and also on my Nexus phone.

    Build v1.05.7_user was delivered this morning on my slate GREY 7

  • How to manually backup and restore iphone content (texts, contacts, data apps) and apps?

    How to manually backup and restore iphone content (texts, contacts, data apps) and apps?

    What do you mean by "back up manually? Do you mean back up some data like contacts, texts selectively?

    Or you don't want the automatic upward, instead, you want to manually create upward?

  • Call method text size prevents string value changes?

    I call the 'Text size' method with an Invoke node on a control to the string every time that a keypress event is marked.

    Curiously, the chain control change never the size. Have I misunderstood the purpose of 'Text size' method?

    Second, if I turn off "Update as you type" attribute, the keypress event is always recorded by the case of the event, but the contents of the string is always returned to the original contents of the string - it becomes impossible to update! Why is this behavior occurs?

    Attached is my demo vi. If you run this and try to change the content, you will see that the string control does not resize the text.

    Disable the "Update as you type" attribute, and it becomes crazy!

    Any suggestions on how to get this to resize the content string while the user types?

    OK, with a lot more research, I found a Subvi from NOR (password protected - grrrr) called Get text Rect

    (Or almost), it returns the rectangle enclosing correct for a single line format of text fonts. With a slight correction, this works well for the large font size that I use.

    Solution set.

    Thanks to anyone who is spending time trying to solve this problem for me!

  • Text size in compiled exe - required tutorial files changes!

    Hello, can someone explain how to manage the text sizes in control and list boxes to make them predictable in the final application?

    I just got very frustrated when an exe compiled labview which works very well on a test PC for a few days has completely changed the size of most of the elements of text when I moved it to the first production machine!

    It started with my upgrade of the development system of LV2015 to LV2015sp1 and at the same time change for a new laptop computer. All the text was larger in the front panels.

    I got little support help to understand this, but many had to be corrected manually. I learned not to use the windows 7 Zoom to 125% or 150% for example.

    Exe, I built and run on the development computer looked like enough to when it is run within the development system.

    But when I installed the software on a PC to test all the text was smaller... I had to move all the controls again and enlarge the text to make it visible.

    And now finally when I took the exe file of work of the test system for the production system the text was bigger still...

    There is clearly something I don't understand here, I hope someone can enlighten me! I mostly let the police stay on "make application 15 p" or whatever the standard configuration is, simply by changing the size if necessary.

    Versions

    All systems are Windows 7 Swedish, all running in 64-bit windows.

    LabVIEW is 32-bit 2015sp1 (tried on the old system of dev with 2015 32 bit - the same result)

    Runtime is LV2015f1 and f3 as I have found no 2015SP1 TERM.

    Set current font to something fixed (standard windows fonts 7 is Segoe UI, in XP it was arial). Do not use any system, dialog, fonts of the application on the façade. Most controls use the application fonts. So Ctrl + A-> set fixed font.  The internal components of the controls (chart axis fonts, type defs) sometimes need to be adjusted manually.

    Check vi has no checkmarks on properties vi-> window size page (keep the proportions for different display resolutions, on the scale as window resizes).

  • Text size in IE8 showing Microsaft update is very low

    Win XP Pro (up to date)

    IE8

    The size of the text in the two central frames of the MS Update home page is too small to read. If I use the wheel to zoom in and out, the text in the upper and lower frames grows and shrinks legibley as expected, but the size of the text in the Central frames is the same small size.

    Zoom works fine on my laptop XP Home Edition. All four images zoom together as planned.

    Hello

    1. don't you make changes to the computer until the problem occurred?

    2. it happens that on this particular website?

    I suggest you to follow the steps below and check if it helps:

    Method 1: Zoom in on a Web page: http://windows.microsoft.com/en-US/windows-vista/Zoom-in-on-a-webpage

    Change webpage text size in Internet Explorer: http://windows.microsoft.com/en-US/windows-vista/Change-webpage-text-size-in-Internet-Explorer

    (For Windows XP)

    Method 2: If the issue then try to optimize Internet Explorer by following the steps mentioned in this link.

    How to optimize Internet Explorer:

    http://support.Microsoft.com/kb/936213/no

    Important: Reset Internet Explorer to its default configuration. This step will disable also any add-ons, plug-ins or toolbars that are installed. Although this solution is fast, it also means that, if you want to use one of these modules in the future, they must be reinstalled.

    Hope this information is useful.

     

  • Text size in Firefox, IE, Outlook Express

    Newly built pc with newly installed XP Pro 2002 SP3.

    In Firefox 3.6, I put some tools/options/content = Times New Roman 24; in advanced size 24; Allow pages select etc. is not enabled. Some web sites display the text of agreement, while some websites have text half of TNR 12 (as measured against the police in the control panel).

    In IE7 I have put in the view/text size but get results similar to Firefox.

    In OE 6, I updated the tools/options/compose TNR 16. Create a message and TNR 14 appears in the boxes above the message box. The first strike TNR 14 reverts to TNR 12.

    Any help appreciated. I'm short hair out.

    Phew! Stumbled upon the solution: set the resolution of the screen. When we installed windows, a few days ago, we used another monitor. On my home screen, all text has been pressed. race to those who responded.

Maybe you are looking for