WEB开发网
开发学院网页设计JavaScript 用JavaScript实现仿Windows关机效果 阅读

用JavaScript实现仿Windows关机效果

 2010-09-14 13:04:20 来源:WEB开发网   
核心提示: 提示:由于该对象比较复杂,读者可以仔细参阅代码的注释部分,用JavaScript实现仿Windows关机效果(5),服务器端代码服务器端首先获得查询中的“id”值,如果该值为null或为空,则设置为默认值,然后判断该值

提示:由于该对象比较复杂,读者可以仔细参阅代码的注释部分。

服务器端代码

服务器端首先获得查询中的“id”值,如果该值为null或为空,则设置为默认值。然后判断该值,并且返回相应的一段字符串信息。处理请求的getInfohtml" class="wordstyle">jsp页面代码如下:

以下是引用片段:<%@ page language="java" import="java.util.*"%>
<%
//获得请求中id的值
String imgID = request.getParameter("id");
if (imgID==null||imgID.equals(""))//如果为null或为空
imgID="one";//设定为默认值
if ( imgID.equals("one"))//如果为one
{
%>
<h3 id="cartitle" style="border-bottom: 1px solid #C0C0C0; margin-bottom: -5px">Porsche Carrera GT</h3>
<p>The Carrera GT has a 5.7 litre V10 internal combustion engine that produces
605 SAE horsepower (451 kW). Porsche claims it will accelerate from 0 to 100
km/h (62 mph) in 3.9 seconds and has a maximum speed of 330 km/h (204 mph).
With 605 hp, the car weighs 1,380 kg (3,042 lb). The Carrera GT is only
offered with a six-speed manual transmission, in contrast to its rival the
Ferrari Enzo that is only offered with sequential manual transmission. Also
the Carrera GT is significantly less expensive than the Ferrari Enzo. The
Ferrari Enzo is priced around $660,000 to the Carrera GT's $440,000. The
Carrera GT is known for its high quality and reliability which makes it one of
the best supercars ever.
<%}else{//否则
%>
<h3 id="cartitle" style="border-bottom: 1px solid #C0C0C0; margin-bottom: -5px">Ferrari Testarossa</h3>
<p>The Ferrari Testarossa is an V12 mid-engined sports car made by Ferrari.
The name, which means "red head", comes from the red painted cylinder heads on
the flat-12 engine. The engine was technically a 180?V engine since it shared
flat-plane crankshaft pins with opposing cylinders. Output was 390 hp (291
kW), and the car won many comparison tests and admirers - it was featured on
the cover of Road & Track magazine nine times in just five years. Almost
10,000 Testarossas, 512TRs, and 512Ms were produced, making this one of the
most common Ferrari models despite its high price and exotic design.
<%}%>
html" class="wordstyle">aspx" snap_preview_added="spa" snap_icon_added="spa" act_suffix ic

上一页  1 2 3 4 5 

Tags:JavaScript 实现 Windows

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接