Kali ini Beben akan mencoba berbagi trik mengenai javascript scroll mouse :D Ketika scroll mouse sobat dinaikturunkan akan ada bilangan +1 ketika naik dan -1 ketika turun. Disini akan kita sisipkan syntax link disamping nominalnya :P Jadi waktu menaikturunkan scroll pada mouse akan ada link blog kitanya sob ;)) Bisa juga link yg dianggap penting, jadi pada tauk itu pengunjung ;;) Rada susah ngejelasinnya juga ah sob ~X( On screenshot :D Click Here for Look Screenshot
Kode CSS
#delta {
font-weight: bold;
color: red;
top: 50%;
left: 3px;
position: fixed;
font-size: 115%;
text-shadow: 0px 0px 10px #888;
filter: alpha(opacity=30);
-moz-opacity: 0.3;
-khtml-opacity: 0.3;
opacity: 0.3
}
#delta a {
color: yellow;
text-decoration: none
}
font-weight: bold;
color: red;
top: 50%;
left: 3px;
position: fixed;
font-size: 115%;
text-shadow: 0px 0px 10px #888;
filter: alpha(opacity=30);
-moz-opacity: 0.3;
-khtml-opacity: 0.3;
opacity: 0.3
}
#delta a {
color: yellow;
text-decoration: none
}
Javascript
Letakin diatas tag </head>Gantilah kode yg diberi warna berbeda itu :) Setelah itu masukin tag HTML dibagian <body><script type='text/javascript'>
//<![CDATA[
function handle(delta){var s=delta+": ";if(delta<0)
s+="<a href='http://your-name-blog.blogspot.com/'>Your Title1</a>";else
s+="<a href='http://your-name-blog.blogspot.com/'>Your Title2</a>";document.getElementById('delta').innerHTML=s;}
function wheel(event){var delta=0;if(!event)event=window.event;if(event.wheelDelta){delta=event.wheelDelta/120;if(window.opera)delta=-delta;}else if(event.detail){delta=-event.detail/3;}
if(delta)
handle(delta);}
if(window.addEventListener)
window.addEventListener('DOMMouseScroll',wheel,false);window.onmousewheel=document.onmousewheel=wheel;
//]]>
</script>
<div id='delta'/>
Dan lihat hasilnya :-bd See yah with Beben si bloglang ganteng kalem tea :D :-hSource by: http://snipplr.com/
Loading... |
12 comments
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/...