PDA

View Full Version : text size


zero1designs
07-28-2005, 01:07 PM
hey,

i have a couple of images and i would like to know how i could, when the user clicks on one of them, all the writing on the page changes to that specific size??

help!

http://www.zero1designs.co.uk

Kor
07-28-2005, 02:04 PM
try this:

<script type="text/javascript">
var fSize = '20px';
function searchT(){
var obj = document.documentElement.getElementsByTagName('*');
for(var i=obj.length-1;i>=0;i--){
if(obj[i].hasChildNodes()){
for(var j=obj[i].childNodes.length-1;j>=0;j--){
changeS(obj[i].childNodes[j])
}
}
}
}
function changeS(kids){
if(kids.nodeType==3){
kids.parentNode.style.fontSize=fSize;
}
return
}
</script>


The function which is to be triggeren onevent is searchT()