日期:2014-05-16 浏览次数:20410 次
JS.Append(" <script type=\"text/javascript\">\n");
JS.Append("var IsPaused=false;\n");
JS.Append("var pix = 0;\n");
JS.AppendFormat("var divWidth = {0};\n", _Items.Count * (_ImageWidth + 1));
JS.AppendFormat("var divVirtualWidth = {0};\n", _NoOfVisibleImages * (_ImageWidth + 1));
JS.Append("function Start()\n");
JS.Append("{\n");
JS.Append("IsPaused = false;\n");
JS.Append("}\n");
JS.Append("function Stop()\n");
JS.Append("{\n");
JS.Append("IsPaused = true;\n");
JS.Append("}\n");
JS.Append("function MoveLeft()\n");
JS.Append("{\n");
JS.Append("if( IsPaused || pix == -(divWidth - divVirtualWidth)) return;\n");
JS.AppendFormat("var objtbl = document.getElementById('{0}');\n", tblBase.ClientID);
JS.Append("pix = parseInt(objtbl.style.left.replace(\"px\",\"\"));\n");
JS.Append("pix = pix - 1;\n");
JS.Append("objtbl.style.left=pix.toString() + \"px\";\n");
JS.Append("setTimeout(\"MoveLeft()\",\"10\");\n");
JS.Append("}\n");
JS.Append("function StopMoveLeft()\n");
JS.Append("{\n");
JS.AppendFormat("if( !IsPaused || pix % {0} == 0) return;\n", _ImageWidth + 1);
JS.AppendFormat("var objtbl = document.getElementById('{0}');\n", tblBase.ClientID);
JS.Append("pix = parseInt(objtbl.style.left.replace(\"px\",\"\"));\n");
JS.Append("pix = pix - 1;\n");
JS.Append("objtbl.style.left=pix.toString() + \"px\";\n");
JS.Append("setTimeout(\"StopMoveLeft()\",\"10\");\n");
JS.Append("}\n");
JS.Append("function MoveRight()\n");
JS.Append("{\n");
JS.Append("if( IsPaused || pix == 0) return;\n");
JS.AppendFormat("var objtbl = document.getElementById('{0}');\n", tblBase.ClientID);
JS.Append("pix = parseInt(objtbl.style.left.replace(\"px\",\"\"));\n");
JS.Append("pix = pix + 1;\n");
JS.Append("objtbl.style.left=pix.toString() + \"px\";\n");