Langsung aja deh Sob Berikut tips membuat widget iklan melayang,Udah lihat demonya kan? tadi waktu buka postingan ini. Widget Iklan melayang ini dilengkapi dengan tombol Close, dan akan menghilang dengan sekali klik. Bagi sobat yang berminat berikut ini kodenya
This is Just Demo
Kodenya
<style type="text/css">
* html #iklan{position:relative;}
#iklan{position:fixed;right:23%;top:0;z-index:+1000;
background:#ddd ;width:50%;height:96%;padding:5px;border:8px solid #ddd;-moz-box-shadow: 0 0 50px #000,inset 0 0 50px #000;-webkit-box-shadow: 0 0 50px #000,inset 0 0 50px #000;box-shadow: 0 0 50px #000,inset 0 0 50px #000;}
</style><script type='text/javascript'>
function showHideiklan(){
var iklan = document.getElementById("iklan");
var w = iklan.offsetWidth;
iklan.opened ? moveiklan(0, 30-w) : moveiklan(20-w, 0);
iklan.opened = !iklan.opened;
}
function moveiklan(x0, xf){
var iklan = document.getElementById("iklan");
var dx = Math.abs(x0-xf) > 10 ? 5 : 1;
var dir = xf>x0 ? 1 : -1;
var x = x0 + dx * dir-100;
iklan.style.top = x.toString() + "px";
if(x0!=xf){setTimeout("moveiklan("+x+", "+xf+")", 10);}
}
</script>
<div id='iklan'>
<div style='-background:#ddd ;height:90%;padding:5px;overflow:auto;'>
<center>
<center>
<a href="javascript:void(0);" onclick="showHideiklan()"><input class="close" style="-moz-box-shadow: 0 0 50px #000,inset 0 0 50px #000; -webkit-box-shadow: 0 0 50px #000,inset 0 0 50px #000; background: #A4A4A4; border: 4px solid #ddd; box-shadow: 0 0 50px #000,inset 0 0 50px #000; color: white; font: 16px Verdana; padding: 5px; width: auto;" type="button" value="Click Here to Close" /></a>
<script type="text/javascript">
var iklan = document.getElementById("iklan");
iklan.style.center = (30-iklan.offsetWidth).toString() + "px";
</script></center>
</div>
Pemasanganya :* html #iklan{position:relative;}
#iklan{position:fixed;right:23%;top:0;z-index:+1000;
background:#ddd ;width:50%;height:96%;padding:5px;border:8px solid #ddd;-moz-box-shadow: 0 0 50px #000,inset 0 0 50px #000;-webkit-box-shadow: 0 0 50px #000,inset 0 0 50px #000;box-shadow: 0 0 50px #000,inset 0 0 50px #000;}
</style><script type='text/javascript'>
function showHideiklan(){
var iklan = document.getElementById("iklan");
var w = iklan.offsetWidth;
iklan.opened ? moveiklan(0, 30-w) : moveiklan(20-w, 0);
iklan.opened = !iklan.opened;
}
function moveiklan(x0, xf){
var iklan = document.getElementById("iklan");
var dx = Math.abs(x0-xf) > 10 ? 5 : 1;
var dir = xf>x0 ? 1 : -1;
var x = x0 + dx * dir-100;
iklan.style.top = x.toString() + "px";
if(x0!=xf){setTimeout("moveiklan("+x+", "+xf+")", 10);}
}
</script>
<div id='iklan'>
<div style='-background:#ddd ;height:90%;padding:5px;overflow:auto;'>
<center>
KODE IKLAN LOE LETAKKAN DISINI SOB
</center></div><center>
<a href="javascript:void(0);" onclick="showHideiklan()"><input class="close" style="-moz-box-shadow: 0 0 50px #000,inset 0 0 50px #000; -webkit-box-shadow: 0 0 50px #000,inset 0 0 50px #000; background: #A4A4A4; border: 4px solid #ddd; box-shadow: 0 0 50px #000,inset 0 0 50px #000; color: white; font: 16px Verdana; padding: 5px; width: auto;" type="button" value="Click Here to Close" /></a>
<script type="text/javascript">
var iklan = document.getElementById("iklan");
iklan.style.center = (30-iklan.offsetWidth).toString() + "px";
</script></center>
</div>
- Login ke Blog sobat, Masuk Elemen Laman
- Klik tambah gadget pilih HTML/javascript
- Pastekan Kode diatas,Ganti tulisan berwarna biru dengan kode iklan sobat.
- Lalu simpan
0 comments:
Post a Comment