Membuat Klik Kanan Dengan CSS dan Javascript pada HTML Part-1

CSS


<style>
.menu{
background-color:#CCC;
color:#000;
width:200px;
height:20px;
left:400px;
top:200px;
position:fixed;
text-align:center;
border:1px solid #000;
}
</style>

Javascript


<script>
function klik(){
document.getElementById("klik_kanan").innerHTML="<div class='menu'>File</div>";
}
</script>

 

HTML


<div id="klik_kanan" oncontextmenu="klik(); return false;" style="background-color:#930; width:100%; height:300px;"></div>

Leave a comment

1 Comment

  1. penting juga neh da… ini klik kanan langsung gimana da? eh da, lu taro demo di tempat gw aja, jadi subdomain, http://rifki.emangdasar.web.id, gw juga pengen demo di subdomain http://desta.emangdasar.web.id da… biar enak ada demonya, gimana?

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: