当前位置: 代码迷 >> Web前端 >> 主页展示6个图片
  详细解决方案

主页展示6个图片

热度:123   发布时间:2012-08-03 00:12:14.0
首页展示6个图片


/csa/WebRoot/edp/layconfig/cssChartLay.jsp
123<div id="lay1" menuId="<s:property value='menuId'/>"></div>
456<div id="lay2" style="margin-top: 5px;"></div>
789<div id="lay3" style="margin-top: 5px;"></div>10000


csa/WebRoot/webpoint/resources/js/edp.js  CssChartLay


---------- 下面为js
function CssChartLay(menuId,month_id) {
window.alert(" CssChartLay---- ");
this.menuId = menuId;
if (typeof CssChartLay._initialized == "undefined") {
CssChartLay.prototype.flush = function (conditions) {
$("#lay1").empty();
$("#lay2").empty();
$("#lay3").empty();
$.getJSON(WebPoint.contextPath+"/edp/layConfig!getCssChartLayConfigs.action?t="+new Date() +"&menuId=" + this.menuId+"&conditions[0].currentValues="+month_id, function (layConfigs) {
for (var i = 0, l = layConfigs.length; i < l&& i < 5; ++i) {
if (layConfigs[i].trendId != null && layConfigs[i].trendId != 0) {
// var trendContainer = $("<td width='50%'><div class='trendContainer'></div></td>");
var trendContainer = $("<div class='trendContainer'></div>");
// var trendContainer2 = $("<td width='50%'><div class='trendContainer2'></div></td>");
if(i<2){
$("#lay1").append(trendContainer);
// $("#lay1").append(trendContainer2);
}else if( i<4 ){
$("#lay2").append(trendContainer);
//$("#lay2").append(trendContainer2);
}else{
$("#lay3").append(trendContainer);
// $("#lay3").append(trendContainer2);
}
new CssChartTrend().flushPage(layConfigs[i].trendId, $(trendContainer), conditions);
//new CssChartTrend().flushPage(layConfigs[i].trendId, $(trendContainer2), conditions);
}
}
});
};
CssChartLay._initialized = true;
}
}
  相关解决方案