Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / Struts2如何实现页面分步骤滑动

Struts2如何实现页面分步骤滑动1.在css文件中加入这两个元素:.fcwindow
{
 width:990px;
 position:relative;
 min-height:400px;
 overflow-x:hidden
}#fccontent
{
 position:relative;
 width:3960px;
 overflow-x:hidden;
}2.在js文件中加入代码:
 
fcnext是下一步!fcup是上一步!然后fcpArray里面的函数,就是各个步骤触发的函数,自行填写即可。在测试阶段可以:a = function(){
    alert("function a");
}
b = function(){
    alert("function b");
}
c = function(){
    alert("function c");
} var fcprocess = 0;// 当前步骤
var fcmaxprocess = 4;// 最大步骤数
var baseMoveLength = 990;// 步骤移动距离
var moveSpeed = 1000;//
var fcpArray = new Array();// 步骤切换时,触发函数//切换函数
fcpArray.push(a);
fcpArray.push(b);
fcpArray.push(c);
this.fcnext = function(index) {
 var left = $("#fccontent").css("left");
 
 var movedis = 0;
 if (left == "auto") {
  movedis = -baseMoveLength;
 } else {
  var l = left.length;
  var d = left.substr(0, l - 2);
  // alert(d+"-"+left);
  movedis = new Number(d);
  movedis -= baseMoveLength;
  // alert(moveid+"ds"+d);
 }
 
 $("#fccontent").animate({
  left : movedis
 }, moveSpeed, function() {
  if (index >= 0) {
 fcpArray[index]();
  } });
};
this.fcup = function(index) {
 var movedis = 0;
 var left = $("#fccontent").css("left");
 if (left == "auto") {
  movedis = 0;
 } else {
  var l = left.length;
  var d = left.substr(0, l - 2);
  movedis = new Number(d);
  movedis += baseMoveLength; } $("#fccontent").animate({
  left : movedis
 }, moveSpeed, function() {
  if (index >= 0) {
 fcpArray[index]();
  }
 });
};3.效果展示:struts2文件上传(保存为BLOB格式) http://www.linuxidc.com/Linux/2014-06/102905.htmStruts2的入门实例 http://www.linuxidc.com/Linux/2013-05/84618.htmStruts2实现ModelDriven接口 http://www.linuxidc.com/Linux/2014-04/99466.htm遇到的Struts2文件下载乱码问题 http://www.linuxidc.com/Linux/2014-03/98990.htmStruts2整合Spring方法及原理 http://www.linuxidc.com/Linux/2013-12/93692.htmStruts2 注解模式的几个知识点 http://www.linuxidc.com/Linux/2013-06/85830.htmStruts 的详细介绍:请点这里
Struts 的下载地址:请点这里本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-11/109162.htm