Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. text resize in my web page

text resize in my web page

Scheduled Pinned Locked Moved C#
javascripttutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bhatted
    wrote on last edited by
    #1

    Hi, I have code in javascript but it resize the text it also resize the image in my page.Let me know how to avoid resize of the image. function resizeText(multiplier) { if (document.body.style.fontSize == "") { document.body.style.fontSize = "12px"; document.body.style.lineHeight = "14px"; } var fontSize = parseInt(document.body.style.fontSize) + (multiplier * 1); if (fontSize <= 17 && fontSize >= 12) { document.body.style.fontSize = parseInt(document.body.style.fontSize) + (multiplier * 1) + "px"; document.body.style.lineHeight = parseInt(document.body.style.lineHeight) + (multiplier * 1) + "px"; var p = document.getElementsByTagName('p'); for (i = 0; i < p.length; i++) { p[i].style.fontSize = (parseInt(document.body.style.fontSize) + "px"); p[i].style.lineHeight = (parseInt(document.body.style.lineHeight) + "px"); }}}

    L 2 Replies Last reply
    0
    • B bhatted

      Hi, I have code in javascript but it resize the text it also resize the image in my page.Let me know how to avoid resize of the image. function resizeText(multiplier) { if (document.body.style.fontSize == "") { document.body.style.fontSize = "12px"; document.body.style.lineHeight = "14px"; } var fontSize = parseInt(document.body.style.fontSize) + (multiplier * 1); if (fontSize <= 17 && fontSize >= 12) { document.body.style.fontSize = parseInt(document.body.style.fontSize) + (multiplier * 1) + "px"; document.body.style.lineHeight = parseInt(document.body.style.lineHeight) + (multiplier * 1) + "px"; var p = document.getElementsByTagName('p'); for (i = 0; i < p.length; i++) { p[i].style.fontSize = (parseInt(document.body.style.fontSize) + "px"); p[i].style.lineHeight = (parseInt(document.body.style.lineHeight) + "px"); }}}

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      This is the C# forum. Not the javascriptweb development forum.

      modified on Friday, January 9, 2009 11:29 AM

      B 1 Reply Last reply
      0
      • L Lost User

        This is the C# forum. Not the javascriptweb development forum.

        modified on Friday, January 9, 2009 11:29 AM

        B Offline
        B Offline
        bhatted
        wrote on last edited by
        #3

        IN c# i am accessing javascript.Do you have any idea .Please let me know. Thnaks

        L 1 Reply Last reply
        0
        • B bhatted

          IN c# i am accessing javascript.Do you have any idea .Please let me know. Thnaks

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          But your error doesn't lie in the C# coding, it lies in the javascript. You won't find much help here for a problem like that.

          1 Reply Last reply
          0
          • B bhatted

            Hi, I have code in javascript but it resize the text it also resize the image in my page.Let me know how to avoid resize of the image. function resizeText(multiplier) { if (document.body.style.fontSize == "") { document.body.style.fontSize = "12px"; document.body.style.lineHeight = "14px"; } var fontSize = parseInt(document.body.style.fontSize) + (multiplier * 1); if (fontSize <= 17 && fontSize >= 12) { document.body.style.fontSize = parseInt(document.body.style.fontSize) + (multiplier * 1) + "px"; document.body.style.lineHeight = parseInt(document.body.style.lineHeight) + (multiplier * 1) + "px"; var p = document.getElementsByTagName('p'); for (i = 0; i < p.length; i++) { p[i].style.fontSize = (parseInt(document.body.style.fontSize) + "px"); p[i].style.lineHeight = (parseInt(document.body.style.lineHeight) + "px"); }}}

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            mkalantri wrote:

            Let me know how to avoid resize of the image.

            Why, are we married, all of a sudden?

            I are troll :)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups