我的javascript代码在Firefox或IE中不起作用

时间:2016-02-04 10:03:31

标签: javascript

我注意到我的网页在Chrome中加载得很好,但我的javascript效果仅适用于Chrome ..

这是一个渐弱的滚动效果,意味着第一个div被点亮,而它下方的div是暗的,当我向下滚动时,顶部的div变暗,而中间的div变亮,依此类推。

有人可以帮我弄清楚它为什么不起作用吗?

这是我的代码:

type
  TMyContext = class(TIdServerContext)
  public
    Request: TIdHTTPRequestInfo;
    Response: TIdHTTPResponseInfo;
    MyServer: TMyHttpServer;
  end;

...

procedure TMyHttpServer.OnCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
  Handler: TWorkEndEvent;
begin
  TMyContext(AContext).Request := ARequestInfo;
  TMyContext(AContext).Response := AResponseInfo;
  TMyContext(AContext).MyServer := Self;
  Handler := MyOnWorkEnd;
  TMethod(Handler).Data := TMyContext(AContext);
  AContext.Connection.OnWorkEnd := Handler
  //...
end;

procedure TMyHttpServer.MyOnWorkEnd(ASender: TObject; AWorkMode: TWorkMode);
var
  aConnection : TIdTCPConnection;
  aContext: TMyContext;
  aServer: TMyHttpServer;
  //...
begin
  aConnection := TIdTCPConnection(ASender);
  aContext := TMyClass(Self);
  aServer := aContext. MyServer;
  //...
end;

0 个答案:

没有答案
相关问题