Assalamualaikum n bonjour ~
Hello peeps. Saya nak buat satu tutorial iaitu disable dragging images. Pebende disable dragging images tu? Mesti korang tak tau kan? Macam ne, sebelumnye, kita boleh drag image kite. Tapi dgn masukkan kod disable ne, memang takleh lah. HAHA cuba korang drag gambar kat atas tu? Takleh kan? Padan muke hoho.
Ok let's begin :)
For Classic Template
1. Dashboard > Template
2. Ctrl+F n cari kod <head>
3. Copy kod dibawah dan pastekan di bawah <head>
<SCRIPT TYPE="text/javascript">
<!--
//Disable right click script
//visit http://www.rainbow.arch.scriptmania.com/scripts/
var message="Thanks for trying to copy my things";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</SCRIPT>
<script type="text/javascript">
document.ondragstart = function () { return false; }; </script>
For Template Designer
1. Dashboard > Design > Edit HTML
2. Ctrl+F n cari kod <head>
3. Copy kod dibawah dan pastekan di bawah <head>
<SCRIPT TYPE="text/javascript">
<!--
//Disable right click script
//visit http://www.rainbow.arch.scriptmania.com/scripts/
var message="Thanks for trying to copy my things";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</SCRIPT>
<script type="text/javascript">
document.ondragstart = function () { return false; }; </script>
4. Save!
Credit : Anis Hazirah
With love,
Farahin ♥ Faiz
Tiada ulasan:
Catat Ulasan