How do i make sure someone clicked something before they can watch the video

Discussion in 'JavaScript' started by jijihuqw, Jul 5, 2011.

  1. #1
    I mean like they have to click something before they watch the video, and i want to know how on some websites they have a popup that says "you have not clicked the ad" or something like that..
    essentially i just need help with a code that when the visitor clicks submit, and they didnt do the requirements, a popup will come up saying that
     
    jijihuqw, Jul 5, 2011 IP
  2. MarPlo

    MarPlo Member

    Messages:
    97
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    48
    #2
    Hy,
    For example, try t set a variable to 0, then , when the user clicks Submit, set that variable to 1.
    Before to display the video, check that variable, if its value is 0, display the popup, else, if it's 1, the video.
     
    MarPlo, Jul 7, 2011 IP
  3. oralunal

    oralunal Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    For example this your advertisement: <a href="http://hit2.me" target="_blank" id="ad">Free Traffic Exchange System</a>
    And there is a div for the movie: <div id="video" style="display: none;">video codes go on here..</div>

    Lets do it with jQuery:
    <script src="jQuery.js"><script>
    <script>
    $(document).ready(function(){
    $("#ad").click(function(){
    $("#video").show();
    });
    });
     
    oralunal, Jul 7, 2011 IP