国庆回家~~

无级缩放图片大小

上一篇 / 下一篇  2007-06-27 10:18:20 / 个人分类:常用代码

无级缩放图片大小

改变图片大小
function resizepic(thispic)
{
if(thispic.width>550){thispic.height=thispic.height*550/thispic.width;thispic.width=550;}
}


无级缩放图片大小
function bbimg(o)
{
  var zoom=parseInt(o.style.zoom, 10)||100;
  zoom+=event.wheelDelta/12;
  if (zoom>0) o.style.zoom=zoom+'%';
  return false;
}
图片链接处加入:
<IMG onmousewheel="return bbimg(this)" style="CURSOR: hand" alt=按此在新窗口浏览图片 src="*.jpg" onload=resizepic(this) align=absMiddle border=0>


双击鼠标滚动屏幕的代码
var currentpos,timer;
function initialize()
{
timer=setInterval ("scrollwindow ()",30);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize

更改字体大小
var status0=';
var curfontsize=10;
var curlineheight=18;
function fontZoomA(){
  if(curfontsize>8){
    document.getElementById('fontzoom').style.fontSize=(--curfontsize)+'pt';
 document.getElementById('fontzoom').style.lineHeight=(--curlineheight)+'pt';
  }
}
function fontZoomB(){
  if(curfontsize<64){
    document.getElementById('fontzoom').style.fontSize=(++curfontsize)+'pt';
 document.getElementById('fontzoom').style.lineHeight=(++curlineheight)+'pt';
  }
}
----------------------------------------------------------------------------------------
<script language="JavaScript" type="text/JavaScript">
将以上代码加在此处
</script>


TAG: 缩放

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-08-24  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 4409
  • 日志数: 53
  • 图片数: 11
  • 影音数: 1
  • 商品数: 1
  • 文件数: 5
  • 书签数: 1
  • 建立时间: 2007-01-03
  • 更新时间: 2008-02-12

RSS订阅

Open Toolbar