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
  1. Home
  2. Web Development
  3. ASP.NET
  4. css expression?

css expression?

Scheduled Pinned Locked Moved ASP.NET
questionjavascriptcss
3 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.
  • M Offline
    M Offline
    mrcooll
    wrote on last edited by
    #1

    hi all, how can i link js file to css file? to do this //cssfile font { font-size:expression(setFontags(this.currentStyle.fontSize)); } // js file containing the function setFontags function setFontags(x){ var y={1:10,2:13,3:16,4:18,5:24,6:32,7:48}; return y[x]+'px'; thx.

    H 1 Reply Last reply
    0
    • M mrcooll

      hi all, how can i link js file to css file? to do this //cssfile font { font-size:expression(setFontags(this.currentStyle.fontSize)); } // js file containing the function setFontags function setFontags(x){ var y={1:10,2:13,3:16,4:18,5:24,6:32,7:48}; return y[x]+'px'; thx.

      H Offline
      H Offline
      himanshu2561
      wrote on last edited by
      #2

      Hi, In your css file write

      .font
      {
      font-size:expression(Test());
      }

      In your external Js file write

      function Test()
      {
      return "10 px";
      }

      In head section f your page write

      ;

      </pre>

      <div class="ForumSig">himanshu</div></x-turndown>

      M 1 Reply Last reply
      0
      • H himanshu2561

        Hi, In your css file write

        .font
        {
        font-size:expression(Test());
        }

        In your external Js file write

        function Test()
        {
        return "10 px";
        }

        In head section f your page write

        ;

        </pre>

        <div class="ForumSig">himanshu</div></x-turndown>

        M Offline
        M Offline
        mrcooll
        wrote on last edited by
        #3

        Thx for u r replay! but. i walked throw this method to overcome modifying too many files , what i need is changing the font size from points to pix without modifing all aspx pages, because of that m trying to find a way to link css file to external javascript file. ---css file ----

        /*m trying to do this inside css file */
        <script type="text/javascript" language="javascript" src="JScript.js">

        /* to be able to call */ expression(Test());

        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