<%@ page language="java" import="java.util.*"pageEncoding="UTF-8"%>

<%

Stringpath = request.getContextPath();

StringbasePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTDHTML 4.01 Transitional//EN">

<html>

<head>

<base href="<%=basePath%>">

<title>My JSP 'index4.jsp' startingpage</title>

<meta http-equiv="pragma"content="no-cache">

<meta http-equiv="cache-control"content="no-cache">

<meta http-equiv="expires"content="0">

<meta http-equiv="keywords"content="keyword1,keyword2,keyword3">

<meta http-equiv="description"content="This is my page">

<script type="text/javascript"src="plug/jquery.js"></script>

</head>

<body>

<input type="text"id="content">

<label><input type="button"name="Submit" value="放大" id="bigger"/></label>

<label><input type="button"name="Submit2" value="缩小" id="small"/></label>

<script type="text/javascript">

$(function(){

var content=$("#content");

$("#bigger").click(function(){

if(content.height()<500){

content.height(content.height()+50);

}

else{

alert("已经够高了");

}

});

$("#small").click(function(){

if(content.height()>50){

content.height(content.height()-50);

}

else{

alert("无法在缩小了");

}

});

});

</script>

</body>

</html>

运行效果如下:


输入框的放大和缩小

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2021-09-02
  • 2021-08-01
  • 2022-12-23
猜你喜欢
  • 2022-01-17
  • 2021-05-14
  • 2021-12-01
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2021-06-04
相关资源
相似解决方案