Creating a pop-up when clicked...

Discussion in 'HTML & Website Design' started by Tommy Kost, Dec 19, 2008.

  1. #1
    And having an embedded video (i.e. YouTube) display in the pop-up?

    Can anybody help me out?

    Thanks in advance,
    - Tommy.
     
    Tommy Kost, Dec 19, 2008 IP
  2. PixelRaider

    PixelRaider Banned

    Messages:
    57
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hey Tommy,

    Put this code in the <head> tag of your HTML file:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=425,height=344');");
    }
    // End -->
    </script>
    Code (markup):
    You can use the following code anywhere in the <body> tag to actually make the window pop up:
    
    <a href="javascript:popUp('popup.html')">Open the Popup Window</a>
    Code (markup):
    In a seperate HTML file named popup.html, place your YouTube embed code. I appreciate different YouTube videos are now different sizes, so you can adjust the height / width of the popup by editing this:

    Hope this helps :)
     
    PixelRaider, Dec 19, 2008 IP
  3. freybear3

    freybear3 Well-Known Member

    Messages:
    409
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #3
    hi

    is this only for youtube videos?
     
    freybear3, Dec 19, 2008 IP
  4. PixelRaider

    PixelRaider Banned

    Messages:
    57
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Not at all, you could place anything in the pop up file. Just make sure you change the width / height of the popup to suit your needs.

    Also, if you want scrollbars / menus etc..change the '0' to '1' in this bit of JavaScript:
    :)
     
    PixelRaider, Dec 19, 2008 IP
  5. Tommy Kost

    Tommy Kost Member

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Hey, thanks a lot!
     
    Tommy Kost, Dec 20, 2008 IP
  6. Karen May Jones

    Karen May Jones Prominent Member

    Messages:
    3,469
    Likes Received:
    290
    Best Answers:
    1
    Trophy Points:
    380
    #6
    Hi, thanks for the code. I need this to open a tool for a visitor, not a video for them. But I'm glad it will work either way. Gottal love the DP search.
    + rep

    oops, I just noticed the contributor is banned. catch u next time!


    Edit again.
    Okay, it worked great. The reason I needed to pop up the window is because the IFRAMED tool has text on it that sez something like "Your Clicks Keep Us Going". :eek: I don't want it like that.

    Here it is. :)

    Article Word Count & Free Online Spell Checker
     
    Karen May Jones, Dec 31, 2008 IP