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. Three second timer

Three second timer

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-netgame-devtutorial
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
    Michael101
    wrote on last edited by
    #1

    Hi Everyone, I've got an C# ASP.NET website which unreal..... But I have one small problem. I don't know how to implement a three second timer to run in the background of my webpage. I want a label to be displayed in red for three seconds and change to blue one the three seconds are up! Does anyone have sample code or ideas to help implement this? Thanks in advance! Michael

    Steve EcholsS 1 Reply Last reply
    0
    • M Michael101

      Hi Everyone, I've got an C# ASP.NET website which unreal..... But I have one small problem. I don't know how to implement a three second timer to run in the background of my webpage. I want a label to be displayed in red for three seconds and change to blue one the three seconds are up! Does anyone have sample code or ideas to help implement this? Thanks in advance! Michael

      Steve EcholsS Offline
      Steve EcholsS Offline
      Steve Echols
      wrote on last edited by
      #2

      Could use javascript:

      setTimeout( "setToBlue()", 3000 ); // 3 second timer

      function setToBlue()
      {
      var label = document.getElementById( "your_label_id" ); // you'll need to figure out the exact id
      label.style.color = "blue";
      }

      This will run when the page loads.


      - S 50 cups of coffee and you know it's on!

      • S
        50 cups of coffee and you know it's on!
        Code, follow, or get out of the way.
      M 1 Reply Last reply
      0
      • Steve EcholsS Steve Echols

        Could use javascript:

        setTimeout( "setToBlue()", 3000 ); // 3 second timer

        function setToBlue()
        {
        var label = document.getElementById( "your_label_id" ); // you'll need to figure out the exact id
        label.style.color = "blue";
        }

        This will run when the page loads.


        - S 50 cups of coffee and you know it's on!

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

        Legend with a few mods it worked like a charm...... thanks for all your help!! Take care, Michael

        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