Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hi im new here and newbee. Need your help.

    Hi pls help me. Im not really a programmer but I know some basic stuff. I just found this code in internet.

    My goal is to add more atleast 3 Videos it a single page without redirecting its video to the other website just stay within the page.

    So sence im not really good in programming So i decided to be like this one, with Hide and show button.

    I want 2 or 3 videos with different HOST "Video 1 Youtube" "Video 2 Vimeo" "Video 3 Dailymotion" something like that , but when I tried to duplicate the code its just the same as the original.

    Can you help me duplicate?

    PHP Code:
    <script type="text/javascript">
    function 
    toggle(obj) {
              var 
    obj=document.getElementById(obj);

              if (
    obj.style.display == "block"obj.style.display "none";
              else 
    obj.style.display "block";
    }


    </script>

    <a href="javascript: void(0);" onClick="toggle('q1')">Video Test 1</a>

    <div id="q1" style="display:none;"><iframe width="420" height="315" src="//www.youtube.com/embed/b8B1O0Fak5s" frameborder="0" allowfullscreen></iframe></div> 

    please forgive my english

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,783
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    The code is a little ugly but as a quick and dirty solution perhaps this works:
    Code:
    
    <a onclick="toggle('q1')">Video Test 1</a>
    <div id="q1" style="display:none;"><iframe width="420" height="315" src="//www.youtube.com/embed/b8B1O0Fak5s" frameborder="0" allowfullscreen></iframe></div>
    
    <a onclick="toggle('q2')">Video Test 2</a>
    <div id="q2" style="display:none;">[put video 2 code here]</div>
    
    <a onclick="toggle('q3')">Video Test 3</a>
    <div id="q3" style="display:none;">[put video 3 code here]</div>
    Watch out for the IDs, they need to be unique.

  • #3
    New to the CF scene
    Join Date
    Mar 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    The code is a little ugly but as a quick and dirty solution perhaps this works:
    Code:
    
    <a onclick="toggle('q1')">Video Test 1</a>
    <div id="q1" style="display:none;"><iframe width="420" height="315" src="//www.youtube.com/embed/b8B1O0Fak5s" frameborder="0" allowfullscreen></iframe></div>
    
    <a onclick="toggle('q2')">Video Test 2</a>
    <div id="q2" style="display:none;">[put video 2 code here]</div>
    
    <a onclick="toggle('q3')">Video Test 3</a>
    <div id="q3" style="display:none;">[put video 3 code here]</div>
    Watch out for the IDs, they need to be unique.

    Thank you for your reply, Im not really that good in programming, I tried your code in an online html tester but its not working.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,783
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    What exactly is happening? What is your current code? Do you have a link for us?


  •  

    Posting Permissions

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