PDA

View Full Version : cleanest site..... i like


chriskq
03-01-2006, 05:02 AM
can anyone tell me the basic principles behind this guys site @
http://www.orangeafro.com/ptg/
at first i thought it was entirely flash based, but its not.
I love the simplicity.

i know there is javascripting and css involved, i am familar with these - but wondering if anyone knew of a tut or something that explains the main principle the dude is using for his site.

any help greatly appreciated.
Thanks all

chriskq
03-01-2006, 05:23 AM
just noticed aswel something else aswel- how do u think he achived the image loader sandglass type of thing
(eg, when you go to his pictures page > click on a thumbnail > depending on the size of the image (obviously) it has a little loader thing. Another thing i wanna learn how to do.
Cheers for any help

Creative Insanity
03-01-2006, 06:14 AM
His site is (at first glance) controled by a file called banjo.js which makes the sites engine javascript.

banjo.js
function doContent(makeVisible) {
document.getElementById("pictureViewer").className="hedgehog";
document.getElementById("thePicture").src="images/spacer.gif";
document.getElementById("navigation").className="nav";
document.getElementById("introduction").className="hedgehog";
document.getElementById("picturebook").className="hedgehog";
document.getElementById("news").className="hedgehog";
document.getElementById("lnks").className="hedgehog";
document.getElementById("about").className="hedgehog";
document.getElementById("copyright").className="hedgehog";
document.getElementById(makeVisible).className="porcupine";
return false;
}

function doPicture(src, w, h) {
document.getElementById("thePicture").src="images/spacer.gif";
document.getElementById("thePicture").width=w;
document.getElementById("thePicture").height=h;
document.getElementById("pictureViewer").className="porcupine";
document.getElementById("navigation").className="altNav";
document.getElementById("thePicture").src="images/pb/"+src+".jpg";
return false;
}






// Style Switcher by Paul Sowden - http://www.alistapart.com/stories/alternate/

function setActiveStyleSheet(title) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
}

function getActiveStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
}
return null;
}

function getPreferredStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("rel").indexOf("alt") == -1
&& a.getAttribute("title")
) return a.getAttribute("title");
}
return null;
}

function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

window.onload = function(e) {
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
}

window.onunload = function(e) {
var title = getActiveStyleSheet();
createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

domedia
03-01-2006, 03:37 PM
i know there is javascripting and css involved, i am familar with these - but wondering if anyone knew of a tut or something that explains the main principle the dude is using for his site. That's basically all there is to it. javascript+css=DHTML. So everything on his site is available in source. Read up on the Document Object Model (DOM) and maybe get Sitepoints book on DHTML, "DHTML Utopia: Modern Web Design Using Javascript and DOM"

Puddinlover
04-10-2006, 09:03 PM
Hmmm i like that whole idea of that site i wanna try something like that BUT being n00b iam i think it looks flash but guys above know what there talking about :D