Jump to content

How to embed another action into Javascript code? (ex-embed a youtube video)


chibicheebs

Recommended Posts

Ok. Sorry that the title was a bit confusing, but this is what I need. I have the Konami code currently working on my website. Here is what I want to happen: If you get the code wrong: I want an alert that states you got it wrong. If you get it right, a youtube video opens in lightbox or fancybox. If this is not possible, how do I simply direct the user to another page on my site? This is my site currently: http://webdesign.miad.edu/stimm/ This is my javascript/jquery code: <script type="text/javascript" src="scripts/jquery.js"></script><script type="text/javascript" src="scripts/konami-JS.js"></script> <script type="text/javascript">konami = new Konami()konami.code = function() {alert("You have entered the KONAMI CODE! You now have 30 lives. Kinda.")} konami.load()</script> The Konami code works (up, up, down, down, left, right, left, right, b, a, enter). It just doesn't do what I want yet.

Link to comment
Share on other sites

You can replace that alert with whatever else you want. Find a lightbox script you want to use and check the documentation to see how to open one to a given URL. If you want to use one that supports arbitrary HTML code in it then you can use the embed code on Youtube to get the HTML that will show a given video.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...