Jika berbicara tentang klik kanan (right click) pada mouse mungkin yang terbesit pada pikiran kita adalah tidak bisa di klik kanan ;)) Secara default pada masing-masing web browser telah disisipkan beberapa konteks menu. Misalkan pada mozilla jika sobat melakukan klik-kanan mouse di area kosong maka akan muncul: go back & go forward one page, Reload current page, <a href=''></a> Sobat bisa tambah variasi target='top' Ingat koma atas satu pakainya jangan yg koma atas dua "" Script di atas sudah ditambahkan sedikit, gak tau bener atau salahnya, tetapi berjalan :D Soalnya kalau pakai dari sumber, pas menanamkan syntax link tidak jalan!!!
Ternyata Circular Contextual App Menu masih sebuah konsep yg perlu pengembangan bro. Karena saya tidak bisa jQuery, silahkan bagi sobat yg mau berbagi ilmunya tolong di fix itu script jQuery di atas :)
BookmarkThis Page, Save Page As, Select all, View Page Source, View Page Info dan Inspect Element. Konteks menu akan lain lagi jika sobat melakukan right-click pada textarea, input, link, image, iframe or etc!
Singkat cerita, bagaimana kalau perintah klik kanan pada mouse diisikan dengan context menu
kreasi kita :-? Jadi kalo ada orang klik-kanan maka akan terpampang 6 menu bulet-bulet (Circular Contextual App Menu) Here original idea codepen.io/simgooder/details/BNLGXm.Seperti itu versi modifan gue bro! Pada source sumber memakai trik font-awesome. Sehingga akan sedikit berbeda pada pemanggilan script. Trick ini terintegrasi dengan jQuery script! Jadi pada template kalian harus sudah terpasang jQuery ;)
.circle-container {
position: relative;
width: 10em;
height: 10em;
padding: 0;
border-radius: 50%;
list-style: none;
-webkit-animation: 0.2s spin linear;
animation: 0.2s spin linear;
margin: 5em auto 0;
position: absolute;
display: none;
}
.circle-container > * {
display: block;
position: absolute;
top: 50%;
left: 50%;
width: 4em;
height: 4em;
margin: -2em;
}
.circle-container > *:nth-of-type(1) {
-webkit-transform: rotate(0deg) translate(5em) rotate(0deg);
-ms-transform: rotate(0deg) translate(5em) rotate(0deg);
transform: rotate(0deg) translate(5em) rotate(0deg);
}
.circle-container > *:nth-of-type(2) {
-webkit-transform: rotate(60deg) translate(5em) rotate(-60deg);
-ms-transform: rotate(60deg) translate(5em) rotate(-60deg);
transform: rotate(60deg) translate(5em) rotate(-60deg);
}
.circle-container > *:nth-of-type(3) {
-webkit-transform: rotate(120deg) translate(5em) rotate(-120deg);
-ms-transform: rotate(120deg) translate(5em) rotate(-120deg);
transform: rotate(120deg) translate(5em) rotate(-120deg);
}
.circle-container > *:nth-of-type(4) {
-webkit-transform: rotate(180deg) translate(5em) rotate(-180deg);
-ms-transform: rotate(180deg) translate(5em) rotate(-180deg);
transform: rotate(180deg) translate(5em) rotate(-180deg);
}
.circle-container > *:nth-of-type(5) {
-webkit-transform: rotate(240deg) translate(5em) rotate(-240deg);
-ms-transform: rotate(240deg) translate(5em) rotate(-240deg);
transform: rotate(240deg) translate(5em) rotate(-240deg);
}
.circle-container > *:nth-of-type(6) {
-webkit-transform: rotate(300deg) translate(5em) rotate(-300deg);
-ms-transform: rotate(300deg) translate(5em) rotate(-300deg);
transform: rotate(300deg) translate(5em) rotate(-300deg);
}
.circle-container li > * {
display: block;
max-width: 100%;
border-radius: 50%;
-webkit-transition: .15s;
transition: .15s;
padding: 2em 0;
line-height: 1;
}
.circle-container li {
border: solid 5px #333;
border-radius: 50%;
box-shadow: 0px 3px 6px #333;
}
.home {
background: #fff url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5b48p0RNt7ukHmPykVS49omPG6Sqqj6MCNaIus7DmoeM7DESwuSf5UNdgZK99f2XmDlpktmidI4IW4-ULLuKH_m8sD6666ryKQLi34SFdrlc4CUdkWvXwbXTURi2MBIGDixzjOOp85pw/s32/) no-repeat center center;
}
.close {
background: #fff url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh23xYnz5FkwLQXWjCsp1l8Mtq9M-mJLBRZyBnnH88n59NyZ10q7RVjL1PqEuCmlBSl8ac54YIw-vnv9f9Mj-RldJfs73F-rLKeSokEak0noYO89adLetjUUlgouqnGyyVDWs3oOKkzegJ5/s32/) no-repeat center center;
}
.menu-1 {
background: #f90 url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpgAlF4DRkDAKS4JBN32mMI10bugQ5BBPF7lCIpdWUe-YIB2ZbZ2n-apB5R0mIJFxRZxquI8yUt9iQfP3MmB3ZK9tVorkG5twnenwdk5cCIK7tdUcKxoTPIZ6vaHde5jrh8KezCFugTPc/s32/) no-repeat center center;
}
.menu-2 {
background: #06f url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCivGTKQqNqG9n-2UXyWh78a9rxOgPituPrFuNzBzJj_spRDPc46QnTKjZby0OBvw3l39oGUqH2pBgO8Gf7ctoZTMqLpCtIMEV4LGZBW2GRvsFj7XlXxhB15bGEIpcFi3IkihsgIY2AAXO/s32/) no-repeat center center;
}
.menu-3 {
background: #09f url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwcyB-TQoHTPjJN-DYQ6FYT1qmHkjVDSHerb-JQdm3-xtxRZZQlqHMxyDdn4w_atuWILRE3RK8JlSAfTSOa8aJ8RhrMpstHlS9mVYOgdv5guz7hy6yjiO6nRlOouXbtpcYIn9-B7Yyr5fe/s32/) no-repeat center center;
}
.menu-4 {
background: #f00 url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivB_Z0p3Vt-NabPSgDCZNO93KdOSR6rsp8_Q2Mkyvac-xmbFnK3344GWIOrRB1lpbwcnugQXOvtHxGBYmrRws9MdE3k7K64xZfD8HvypzsfA6dgoOVtnadODzfVxrhKmla8s9MPhpx3qQ/s32/) no-repeat center center;
}
.menu-5 {
background: #fff url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOmpEbhVHXcJJfh1Ih7ccI0ylw70bOEqK0Oc5FcQWQrPDUzJ50jmQDSWCYAJ1U7xE8IKJeetEIoqj2EU6JA1-I8eysqsjpb__tkkuh7h-X5XjZq0X6GwUTDNCZVQG6gneCQX2aKiIVBGnY/s32/) no-repeat center center;
}
.hide {
-webkit-animation: 0.2s spinout linear !important;
animation: 0.2s spinout linear !important;
}
@-webkit-keyframes spin {
0% {
opacity: 0;
-webkit-transform: rotate(90deg) scale(0);
transform: rotate(90deg) scale(0);
}
30% {
opacity: 0;
}
}
@keyframes spin {
0% {
opacity: 0;
-webkit-transform: rotate(90deg) scale(0);
transform: rotate(90deg) scale(0);
}
30% {
opacity: 0;
}
}
@-webkit-keyframes spinout {
0% {
opacity: 1;
}
70% {
opacity: 0;
-webkit-transform: rotate(90deg) scale(0);
transform: rotate(90deg) scale(0);
}
}
@keyframes spinout {
0% {
opacity: 1;
}
70% {
opacity: 0;
-webkit-transform: rotate(90deg) scale(0);
transform: rotate(90deg) scale(0);
}
}
Jika mau mengganti gambar, gantilah dengan yang memiliki resolusi 32 x 32 pixel.position: relative;
width: 10em;
height: 10em;
padding: 0;
border-radius: 50%;
list-style: none;
-webkit-animation: 0.2s spin linear;
animation: 0.2s spin linear;
margin: 5em auto 0;
position: absolute;
display: none;
}
.circle-container > * {
display: block;
position: absolute;
top: 50%;
left: 50%;
width: 4em;
height: 4em;
margin: -2em;
}
.circle-container > *:nth-of-type(1) {
-webkit-transform: rotate(0deg) translate(5em) rotate(0deg);
-ms-transform: rotate(0deg) translate(5em) rotate(0deg);
transform: rotate(0deg) translate(5em) rotate(0deg);
}
.circle-container > *:nth-of-type(2) {
-webkit-transform: rotate(60deg) translate(5em) rotate(-60deg);
-ms-transform: rotate(60deg) translate(5em) rotate(-60deg);
transform: rotate(60deg) translate(5em) rotate(-60deg);
}
.circle-container > *:nth-of-type(3) {
-webkit-transform: rotate(120deg) translate(5em) rotate(-120deg);
-ms-transform: rotate(120deg) translate(5em) rotate(-120deg);
transform: rotate(120deg) translate(5em) rotate(-120deg);
}
.circle-container > *:nth-of-type(4) {
-webkit-transform: rotate(180deg) translate(5em) rotate(-180deg);
-ms-transform: rotate(180deg) translate(5em) rotate(-180deg);
transform: rotate(180deg) translate(5em) rotate(-180deg);
}
.circle-container > *:nth-of-type(5) {
-webkit-transform: rotate(240deg) translate(5em) rotate(-240deg);
-ms-transform: rotate(240deg) translate(5em) rotate(-240deg);
transform: rotate(240deg) translate(5em) rotate(-240deg);
}
.circle-container > *:nth-of-type(6) {
-webkit-transform: rotate(300deg) translate(5em) rotate(-300deg);
-ms-transform: rotate(300deg) translate(5em) rotate(-300deg);
transform: rotate(300deg) translate(5em) rotate(-300deg);
}
.circle-container li > * {
display: block;
max-width: 100%;
border-radius: 50%;
-webkit-transition: .15s;
transition: .15s;
padding: 2em 0;
line-height: 1;
}
.circle-container li {
border: solid 5px #333;
border-radius: 50%;
box-shadow: 0px 3px 6px #333;
}
.home {
background: #fff url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5b48p0RNt7ukHmPykVS49omPG6Sqqj6MCNaIus7DmoeM7DESwuSf5UNdgZK99f2XmDlpktmidI4IW4-ULLuKH_m8sD6666ryKQLi34SFdrlc4CUdkWvXwbXTURi2MBIGDixzjOOp85pw/s32/) no-repeat center center;
}
.close {
background: #fff url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh23xYnz5FkwLQXWjCsp1l8Mtq9M-mJLBRZyBnnH88n59NyZ10q7RVjL1PqEuCmlBSl8ac54YIw-vnv9f9Mj-RldJfs73F-rLKeSokEak0noYO89adLetjUUlgouqnGyyVDWs3oOKkzegJ5/s32/) no-repeat center center;
}
.menu-1 {
background: #f90 url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpgAlF4DRkDAKS4JBN32mMI10bugQ5BBPF7lCIpdWUe-YIB2ZbZ2n-apB5R0mIJFxRZxquI8yUt9iQfP3MmB3ZK9tVorkG5twnenwdk5cCIK7tdUcKxoTPIZ6vaHde5jrh8KezCFugTPc/s32/) no-repeat center center;
}
.menu-2 {
background: #06f url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCivGTKQqNqG9n-2UXyWh78a9rxOgPituPrFuNzBzJj_spRDPc46QnTKjZby0OBvw3l39oGUqH2pBgO8Gf7ctoZTMqLpCtIMEV4LGZBW2GRvsFj7XlXxhB15bGEIpcFi3IkihsgIY2AAXO/s32/) no-repeat center center;
}
.menu-3 {
background: #09f url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwcyB-TQoHTPjJN-DYQ6FYT1qmHkjVDSHerb-JQdm3-xtxRZZQlqHMxyDdn4w_atuWILRE3RK8JlSAfTSOa8aJ8RhrMpstHlS9mVYOgdv5guz7hy6yjiO6nRlOouXbtpcYIn9-B7Yyr5fe/s32/) no-repeat center center;
}
.menu-4 {
background: #f00 url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivB_Z0p3Vt-NabPSgDCZNO93KdOSR6rsp8_Q2Mkyvac-xmbFnK3344GWIOrRB1lpbwcnugQXOvtHxGBYmrRws9MdE3k7K64xZfD8HvypzsfA6dgoOVtnadODzfVxrhKmla8s9MPhpx3qQ/s32/) no-repeat center center;
}
.menu-5 {
background: #fff url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOmpEbhVHXcJJfh1Ih7ccI0ylw70bOEqK0Oc5FcQWQrPDUzJ50jmQDSWCYAJ1U7xE8IKJeetEIoqj2EU6JA1-I8eysqsjpb__tkkuh7h-X5XjZq0X6GwUTDNCZVQG6gneCQX2aKiIVBGnY/s32/) no-repeat center center;
}
.hide {
-webkit-animation: 0.2s spinout linear !important;
animation: 0.2s spinout linear !important;
}
@-webkit-keyframes spin {
0% {
opacity: 0;
-webkit-transform: rotate(90deg) scale(0);
transform: rotate(90deg) scale(0);
}
30% {
opacity: 0;
}
}
@keyframes spin {
0% {
opacity: 0;
-webkit-transform: rotate(90deg) scale(0);
transform: rotate(90deg) scale(0);
}
30% {
opacity: 0;
}
}
@-webkit-keyframes spinout {
0% {
opacity: 1;
}
70% {
opacity: 0;
-webkit-transform: rotate(90deg) scale(0);
transform: rotate(90deg) scale(0);
}
}
@keyframes spinout {
0% {
opacity: 1;
}
70% {
opacity: 0;
-webkit-transform: rotate(90deg) scale(0);
transform: rotate(90deg) scale(0);
}
}
Isikan alamat link pada syntax<script type='text/javascript'> //<![CDATA[ $(document).bind("contextmenu", function(event) { event.preventDefault(); var circle = "<ul class='circle-container' style='display:block;'><li class='home'> <a href='' target='top'></a> </li><li class='menu-1'><a href=''></a> </li><li class='menu-2'><a href=''></a> </li><li class='menu-3'><a href=''></a> </li><li class='menu-4'><a href=''></a> </li><li class='menu-5'><a href=''></a> </li><li class='close'><a href=''></a> </li></ul>"; $(circle) .appendTo("body") .css({top: event.pageY-160 + "px", left: event.pageX-80 + "px"}); }); $('.circle-container').get(0).click(); //Better solution - Button Specific $(document).mousedown(function(e){ if( e.which==1 ) { $(".circle-container").toggleClass("hide"); setTimeout(function(){ $(".circle-container").hide(); },100); } }); //]]> </script>
Ternyata Circular Contextual App Menu masih sebuah konsep yg perlu pengembangan bro. Karena saya tidak bisa jQuery, silahkan bagi sobat yg mau berbagi ilmunya tolong di fix itu script jQuery di atas :)
Hmmm....:-<
Loading... |
DO NOT EVEN TRY ADD LINK [-X
You can use some HTML tags, such as
<b> - <i> - <a> - http://...jpg/gif/png/bmp - http://youtu.be/...