复制代码代码如下:
<%@ page lenguaje = "java" contentType = "text/html; charset = utf-8"
PageEncoding = "UTF-8"%>
<%
String ruta = request.getContextPath ();
String basepath = request.getScheme () + ": //"
+ request.getServerName () + ":" + request.getServerPort ()
+ ruta + "/";
String groupId = request.getParameter ("GroupId");
%>
<! DocType html public "-// w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<Evista>
<meta http-equiv = "content-type" content = "text/html; charset = utf-8">
<script type = "text/javaScript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"> </script>
<meta content = "width = dispositivo-width, inicial a escala = 1.0, escala máxima = 1.0, user-scalable = no" name = "Viewport">
<title> 宝宝排行榜 </title>
<style type = "text/css">
cuerpo {
Text-Align: Center;
margen: 0 auto;
relleno: 0;
Antecedentes: #ffefe5;
Ancho: 100%;
}
A: enlace {
Decoración de texto: ninguna;
}
#static {
margen: 0 auto;
text-align: izquierda;
}
img {
Ancho: 100%;
}
#principal {
Antecedentes: url ("../ pic/bj_12.jpg") repetir-x;
Top-top: 5px;
}
#Main Span {
tamaño de fuente: 1.5em;
Color: #2F0075;
margen izquierda: 40px;
}
#abajo {
Ancho: 100%;
margen: 0;
relleno: 0;
tamaño de fuente: 1em;
}
#bottom ul li {
Ancho: 48%;
flotante: izquierda;
margen -izquierda: -8%;
margen-derecha: 10%;
Tipo de estilo de lista: Ninguno;
}
.sp {
margen -top: -50px;
Border-Radius: 8px;
}
</style>
<script type = "text/javaScript">
$ (function () {
// 动态加载宝贝排行信息
función loadSecondSort () {
$ .AJAX ({
Tipo: "Publicar",
Datos: "GroupId ="+$ ("#GroupId"). Val (),
URL: "<%= basepath%> findbobyrankbyvote.action",
éxito: function (data) {
var list = data.list;
var fila = "";
$ ("ul"). vacía ();
if (list! = null && list.length! = 0) {
for (var i = 0; i <list.length; i ++) {
fila = "" <li> <a href =/"bao_x.jsp? id ="+list [i] .id+"/"> <img src =/"../ pic/"+list [i] .pic+"/"> </a> <input type =/"Hidden/" id =/"id/" valor = "+list [i] .id+"> <div class =/"
"style =/" Color de fondo: #FFB7CD; margen-top: 10px; Altura: 30px/">"+
"<img src =/" ../ pic/zan.png/"style =/" ancho: 22px; margen-izquierda: 10px; margen-top: 5px;/"class =/" favor/">"+
"<span style =/" margin-top: 5px; Color: #8A7DA9; flotante: correcto; margen-right: 10px;/"> 已 <span>"+list [i] .vote+"</span> 票"+
"</span> </div> </li>";
$ (fila) .appendTo ($ ("ul"));
}
}
}
});
}
$ (". favor"). Live ("Click", function () {
var id = $ (this) .closest ("li"). find ("#id"). val ();
$ .post ("<%= basepath%> updateBobyrank.action", "id =" + id,
función (datos) {
if (data.msg == null) {
if (data.success == true) {
LoadSecondSort ();
}
}demás {
alerta (data.msg);
}
});
});
Window.Onload = LoadSecondSort ();
});
</script>
</ablo>
<Body>
<input type = "hidden" id = "groupId" value = "<%= groupId%>">
<div id = "estático">
<img src = "../ pic/top10.jpg"> <a href = "../ jsp/index.jsp"> <img
src = "../ pic/fan.png"> </a>
<div id = "main">
<span> 近期排名: </span>
</div>
<div id = "fondo">
<ul>
</ul>
</div>
</div>
</body>
</html>