用 JavaScript 实现网页图片等比例缩放
<script language="JavaScript" type="text/javascript">
<!--
// 说明:用 JavaScript 实现网页图片等比例缩放
// 整理:http://www.CodeBit.cn
function DrawImage(ImgD,FitWidth,FitHeight)
{
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0)
{
if(image.width/image.height>= FitWidth/FitHeight)
{
if(image.width>FitWidth)
{
ImgD.width=FitWidth;
ImgD.height=(image.height*FitWidth)/image.width;
}else
{
&
相关文档:
var a = document.getElementById("left");
var b = document.getElementById("right");
if(a.scrollHeight < b.scrollHeight)
{
a.style.height = b.scrollHeight+”px”;
} &nb ......
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>JS调用现成Word模板完成打印</title>
<script type="text/javascript">
//转换word的函数
function ......
1.如何获取表单<select>域的选择部分的文本?
<form name="a">
<select name="a" size="1" onchange="_sel(this)">
<option value="a">1</option>
<option value="b">2</option>
<option value="c">3</option>
</select>
</form&g ......
设为首页和添加收藏的Javascript代码,兼容性还可以,各种主流浏览器都测试通过了。
function addfavorite(){//加入收藏
if (document.all){
window.external.addFavorite("http://"+document.location.host+"/",document.title);
}else if (window.sidebar){
window.sidebar.addPanel(document.tit ......
// 下拉列表类
// PubEdition: Version 1.0.0.0
// ModifyDate: 2009-12-09 9:30:00
// FinishDate: 2009-12-09 9:30:00
// AuthorName: binbin( Mail:pl45@163.com / Tel:13893302154 )
var droplistswap=function(){};
droplistswap.prototype.originalElement=new Array();
// droplistswap.prototype.hidedropl ......