Created
June 21, 2013 10:00
-
-
Save talnetd/5830209 to your computer and use it in GitHub Desktop.
A CodePen by Tin Aung Linn. Html5 Context Menu - Inspired from David and tweet myself a little. Just miss obey DRY :P.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="header" contextmenu="mymenu"> | |
<header> | |
<h1>HTML5</h1> | |
<menu type="context" id="mymenu"> | |
<menuitem label="Refresh Post" onclick="window.location.reload();" > | |
</menuitem> | |
<menu label="Share on..."> | |
<menuitem label="Twitter" onclick="goShare('http://twitter.com/intent/tweet?text=' + document.title + ': ' + window.location.href);"> | |
</menuitem> | |
<menuitem label="Facebook" onclick="goShare('http://facebook.com/sharer/sharer.php?u=' + window.location.href);"> | |
</menuitem> | |
</menu> | |
</menu> | |
</header> | |
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function goShare(url) { | |
window.open(url,"shareWindow"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
padding:0; | |
margin:0; | |
} | |
.container { | |
width:50%; | |
height: auto; | |
margin: auto; | |
padding-top: 10%; | |
} | |
#header { | |
width:100%; | |
text-align: center; | |
padding-top:45px; | |
padding-bottom: 50px; | |
background:#ddd; | |
border:solid 5px #000; | |
} | |
#header header h1 { | |
font-size: 5em; | |
color: #fff; | |
text-shadow: 3px 3px 3px #000; | |
font-family: Arial; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment