css - Have a clickable image to open embedded content in wordpress - Space Invaders -


I would like to be able to click on an image on any of my blog pages and then add some embedded content to it.

Specifically, I would like to create a cover image for the game of this space invaders here:

Embed code =

     

I would like to click on my custom cover image in this page and then the game will start, but I do not know how to do it.

I 've used WordPress for some years, but only minor style changes are ... nothing like that.

Any help for the beginning will be greatly appreciated! I'm not an experienced programmer.

-C

Here you can do it with jQuery, one Javascript library is:

  & lt; Style & gt; #cover {width: 480px; Height: 360px; Background: URL (JPG) left top duplication; } #game {display: none; Width: 480px; Height: 360px; } & Lt; / Style & gt; & Lt; Div id = "cover" & gt; & Lt; / Div & gt; & Lt; Div id = "game" & gt; & Lt; Object & gt; ... & lt; / Object & gt; & Lt; / Div & gt; & Lt; Script & gt; $ (Function () {$ ('# cover'). Click (function () {$ (this) .slideUp (); $ ('# game'). SlideDown ();});}); & Lt; / Script & gt;   

Note that you must configure WordPress and your editor to allow javascript and object or iframe. If you do not already have jQuery available on the site, then you can use this tag to load from Google:

  & lt; Script src = "// ajax.googleapis.com/ajax/ libs / jQuery / 1.9.1 / jquery.min.js" & gt; & Lt; / Script & gt;    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -