Media

m2o ..

G inget ini prototype lain yg prnh g bongkar2 dulu, skrg lagi coba biar bisa embed ke format ASP (active server page). Ada 2 file JS tambahan yg attached dengan script utama ini, yang nantinya akan membuat tampilan menu collapse dan expand (vertikal) .. lumayan untuk tampilan informasi yg simpel, padat dan gak perlu scroll2 layar ..

//the main function, call to the effect object
function init(){

var stretchers = document.getElementsByClassName(‘stretcher’); //div that stretches
var toggles = document.getElementsByClassName(‘display’); //h3s where I click on

//accordion effect
var myAccordion = new fx.Accordion(
toggles, stretchers, {opacity: true, duration: 400}
);

//hash function

function checkHash(){
var found = false;
toggles.each(function(h3, i){
if (window.location.href.indexOf(h3.title) > 0) {
myAccordion.showThisHideOpen(stretchers[i]);
found = true;
}
});
return found;
}

if (!checkHash()) myAccordion.showThisHideOpen(stretchers[0]);

bUzz: kelihatannya simpel tapi ampun, ribet abizzz ..

Leave a Reply

Your email address will not be published. Required fields are marked *