Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Support
  • Code University
  • Cross browser version?
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
Cross browser version?
Tweet Topic Started: Sep 15 2008, 10:25 AM (152 Views)
Blackbolt Sep 15 2008, 10:25 AM Post #1
Member Avatar
Learning as i go

Posts:
28
Group:
Member
Member
#795
Joined:
Aug 30, 2008
Coding language
HTML/CSS
Is there a version of this code that works in both Firefox and IE

Code:
 

<script type='text/javascript'>
/*
Shrink Post Images v1.1
Created by iFusion
*/
function shrink_images(maxImgWidth, maxImgHeight){
if(location.href.match(/showtopic/) == null) return;

var iDiv = document.getElementsByTagName('DIV');
for(i=0;i<iDiv.length;i++){
if(iDiv[i].className!="postcolor") continue;

var imgs = iDiv[i].getElementsByTagName('IMG');
for(j=0;j<imgs.length;j++){
if(!imgs[j].width || imgs[j].width == 0) continue;

while(imgs[j].width > maxImgWidth){
imgs[j].width = Math.floor( imgs[j].width - (imgs[j].width / 10) );
imgs[j].height = Math.floor( imgs[j].height - (imgs[j].height / 10) );
}
while(imgs[j].height > maxImgHeight){
x[0] = Math.floor( imgs[j].width - (imgs[j].width / 10) );
imgs[j].height = Math.floor( imgs[j].height - (imgs[j].height / 10) );
}
imgs[j].onclick=function(){ window.open(this.src);}
imgs[j].onmouseover=function(){this.style.cursor="ne-resize"}
}
}
}

shrink_images(150,150);
</script>


Thanks

BB
Posted Image
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Enjoy forums? Start your own community for free.
Learn More · Register Now
« Previous Topic · Code University · Next Topic »
Locked Topic

Track Topic · E-mail Topic Time: 7:45 PM Jul 10
Hosted for free by ZetaBoards · Privacy Policy