Jumat, Maret 25, 2011

Blogger : Show hide Guestbook/Shoutbox/Shoutmix

Script CSS :

#gb{
position:fixed;
top:50px;
z-index:+1000;
}
* html #gb{position:relative;}
.gbtab{
height:200px;
width:30px;
float:left;
cursor:pointer;
background:url("http://purwomartono.googlepages.com/slider_shoutmix.gif") no-repeat;
}
.gbcontent{
float:left;
border:5px solid #000000;
background:#FFFFFF;
padding:5px;
}


Script Javascript :

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-4639370-4']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

window.google_analytics_uacct = "UA-4639370-4";

function showHideGB(){
var gb = document.getElementById("gb");
var w = gb.offsetWidth;
gb.opened ? moveGB(0, 30-w) : moveGB(20-w, 0);
gb.opened = !gb.opened;
}
function moveGB(x0, xf){
var gb = document.getElementById("gb");
var dx = Math.abs(x0-xf) > 10 ? 5 : 1;
var dir = xf>x0 ? 1 : -1;
var x = x0 + dx * dir;
gb.style.right = x.toString() + "px";
if(x0!=xf){setTimeout("moveGB("+x+", "+xf+")", 10);}
}

var gb = document.getElementById("gb");
gb.style.right = (30-gb.offsetWidth).toString() + "px";



Source html :







ShoutMix chat widget






Source : http://rtn-alwaysforyou.blogspot.com/2010/08/membuat-show-hide-guestbook.html? kiss

Senin, Maret 21, 2011

JQuery : Autocomplete extraParams

Case : You want to create an autocomplete that depends on another fields
Solution : Using JQuery Autocomplete with extraParams
Script :


$("#ProvinsiCalonSuami").autocomplete("actions/autocomplete.php?p=provinsi", {
max: 100,
width: 260,
selectFirst: true,
});

$("#KabupatenCalonSuami").autocomplete("actions/autocomplete.php?p=kabupaten", {
max: 100,
width: 260,
selectFirst: true,
extraParams: {
provinsi: function(){
return $('#ProvinsiCalonSuami').val();
}
}
});

$("#KecamatanCalonSuami").autocomplete("actions/autocomplete.php?p=kecamatan", {
max: 100,
width: 260,
selectFirst: true,
extraParams: {
kabupaten: function(){
return $('#KabupatenCalonSuami').val();
}
}
});

$("#KelurahanCalonSuami").autocomplete("actions/autocomplete.php?p=kelurahan", {
max: 100,
width: 260,
selectFirst: true,
extraParams: {
kecamatan: function(){
return $('#KecamatanCalonSuami').val();
}
}
});
Source : http://docs.jquery.com/Plugins/autocomplete

Sabtu, Maret 19, 2011

JQuery : Autocomplete not working more than 10 rows

Case : You are using JQuery autocomplete, but the data cannot display more than 10 rows
Solution : using option "Max"
Script :

$().ready(function() {
$("#targetDiv1").autocomplete("actions/autocomplete.php?p=provinsi", {
max: 100,
width: 260,
selectFirst: false,
});

$("#targetDiv2").autocomplete("actions/autocomplete.php?p=kabkota", {
max: 100,
width: 260,
selectFirst: false,
});

$("#targetDiv3").autocomplete("actions/autocomplete.php?p=kecamatan", {
max: 100,
width: 260,
selectFirst: false,
});
});

Selasa, Maret 15, 2011

Javascript : getElementById inside looping For

Mikir gini habis seharian


function formValidator(numrows,jumlah_soal) {
var id_soal = "";
if (numrows < jumlah_soal) {
var x = jumlah_soal;
} else {
var x = numrows;
}

for (var i=1;i<=x;i++) {
var id = document.getElementById("id_soal_"+i).value;
if (id_soal == "") {
var id_soal = id;
} else {
var id_soal = id_soal+', '+id;
}
}

$.post("actions/soal_simpan.php", { id: id_soal} );
window.location.href = "index.php?p=soal_create";
window.open("cetak/soal_simpan.php?id_soal="+id_soal,"print","width=800,height=400px,scrollbars=yes");
}

Install Office 2003 dan Office 2007

http://uksbsguy.com/blogs/doverton/archive/2007/07/21/how-to-get-rid-of-the-installer-configuration-dialog-when-running-office-2007-and-office-2003-on-the-same-system-for-vista-and-other-versions-of-windows.aspx


reg add HKCU\Software\Microsoft\Office\11.0\Word\Options /v NoReReg /t REG_DWORD /d 1
reg add HKCU\Software\Microsoft\Office\12.0\Word\Options /v NoReReg /t REG_DWORD /d 1

reg add HKCU\Software\Microsoft\Office\11.0\Excel\Options /v NoReReg /t REG_DWORD /d 1
reg add HKCU\Software\Microsoft\Office\12.0\Excel\Options /v NoReReg /t REG_DWORD /d 1