Help with javascript show then hide

by Colton
2 replies
Here's what I'm trying to do. I have a simple page with a video on it and I want an add to cart image and link to pop up at certain times under the video and then hide. I want it to do show then hide 3 times. Currently I'm doing it like this.
Code:
function showme() {
      document.getElementById("hid1").style.visibility = "visible";
    }
    setTimeout("showme()", 5000 ); 
    
 
    function showme(){
        document.getElementById( "hid1" ).style.display = "none" ;
    }
    setTimeout("showme()", 7000 );
I'm doing that for each div. What's the best way to do this? Thanks.
#hide #javascript #show
  • Profile picture of the author bugbuguk
    tbh , its probs the most efficient way already. Keep it up
    Signature

    Google News Press Releases , PM For Details :)

    {{ DiscussionBoard.errors[2574586].message }}
  • Profile picture of the author dealbert.net
    The only thing that I can think of is the cross browser compatibility. You probably would be better off using one of the javascript framework, like YUI, jQuery, or Dojo. Personally, I perfer jQuery mostly it's so easy to get started and tons of community support, and also packed with build-in animations.
    {{ DiscussionBoard.errors[2579484].message }}

Trending Topics