könnt ihr mir vielleicht sagen ob ich mit folgendem script die höhe und breite meiner #menu bestimmen kann ? siehe auch:
www.brasilguide.de
Code: Alles auswählen
function gettoselectingwords(){
function getASCIIVowels (string){
string = string.replace (/ö/g,"ö");
string = string.replace (/Ö/g,"Ö");
string = string.replace (/ä/g,"ä");
string = string.replace (/Ä/g,"Ä");
string = string.replace (/ü/g,"ü");
string = string.replace (/Ü/g,"Ü");
string = string.replace (/ß/g,"ß");
return string;
}
/**
* This highlightWord - funktion is from:
* http://www.kryogenix.org/
**/
function highlightWord(node,word) {
if (node.hasChildNodes) {
//var hi_cn;
for (var hi_cn=0; hi_cn<node.childNodes.length; hi_cn++) {
highlightWord(node.childNodes[hi_cn],word);
}
}
if (node.nodeType == 3) {
var tempNodeVal = node.nodeValue.toLowerCase();
tempWordVal = word.toLowerCase();
if (tempNodeVal.indexOf(tempWordVal) != -1) {
var pn = node.parentNode;
if (pn.className != "searchword") {
var nv = node.nodeValue;
var ni = tempNodeVal.indexOf(tempWordVal);
var before = document.createTextNode(nv.substr(0,ni));
var docWordVal = nv.substr(ni,word.length);
var after = document.createTextNode(nv.substr(ni+word.length));
var hiwordtext = document.createTextNode(docWordVal);
var hiword = document.createElement("strong");
hiword.className = "searchword";
hiword.appendChild(hiwordtext);
pn.insertBefore(before,node);
pn.insertBefore(hiword,node);
pn.insertBefore(after,node);
pn.removeChild(node);
}
}
}
}
var ref_url = location.search;
if (ref_url.indexOf("?") == -1) {
return;
}
ref_url = unescape(ref_url.substring(15,ref_url.length));
var ref_words = ref_url.split("&");
for (var i=0; i<ref_words.length; i++){
highlightWord(document.getElementsByTagName("body")[0],ref_words[i]);
}
}
window.onload = gettoselectingwords;
</script>
sony