SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Addict
    Join Date
    May 2006
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    divider id on a timer

    Hello, anyone have anything to put a divider on a timer? I know how to use setTimeout, I just don't know how to do this with a div. Please let me know, thank you very much!

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What are you trying to do?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Addict
    Join Date
    May 2006
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is all I have so far, I know its wrong. Just can't find any help on google. I am trying to put the div divider on a timer.

    <script type="text/javascript">
    changediv(){
    document.getElementById("div");
    setTimeout('changediv()',1000);}
    </script>

    <div id="div">
    </div>

  4. #4
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're confused. You can't put an element on a timer. However, you can put a function on a timer, which is what you're doing. What do you want the function to do?

    Your code is fine, though "div" is not a very good ID for an element.

    Use class with semantics in mind
    The Meaning of Semantics Take II: Naming Conventions for Class and ID in CSS
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  5. #5
    SitePoint Addict
    Join Date
    May 2006
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really? You can't put a div on a timer? Thought you could. What about a table, can you put that on a timer? If anyone knows otherwise please let me know, thanks.

  6. #6
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Exactly what do you wanna do? Your sample code will be wall every second and do... nothing.

  7. #7
    SitePoint Addict
    Join Date
    May 2006
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Forget about my function, I already said I did it wrong and why I need help. Just trying to put a divider on a timer but Krav says I can't.

  8. #8
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, but thats the thing, I don't really get what you want to achieve

  9. #9
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you wanting to hide/show a timer after a set time?

    You really need to make posts informative to allow other people to help. I'm amazed that people have actually taken their time to find out actually what you require.

    setTimeout will fire an action after a set amount of time.


  10. #10
    SitePoint Addict
    Join Date
    May 2006
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean? I made myself so clear. I said I needed to put a divider on a javascript timer. I even showed an example of what I am trying to do, even if it doesn't work. That is so much more clear than I have seem most other posts be. I don't care what kind of timer, I'll figure that out later, I just need to know if it can be done.

  11. #11
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, apparently you didn't make yourself clear. 4 people still don't get what you want to achieve. Just repeating the same phrase again and again will not make the issue clearer.

  12. #12
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You made your self clear that you want to put a divider on a timer. But what we need to know is what do you want to do when that timer expires?

    as said you can only give setTimeout an function or action to fire when the given time expires. You can't simply pass it an element and hope.

    If you could let us know exactly what you want the divider (div I am guessing) to do when the timer expires, and then we can help you further.

    You can't simply go to the doctor and say I feel ill, you have to elabourate (sp) to get a successful diagnosis.

    I apologize if I am coming across a bit hasty, it's not intended, we are only trying to get somewhere so we can help you.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •