silverlight小技巧
- 在页面初始化时添加代码
{
double mouseDelta = 0;
ScriptObject e = args.EventObject;
// Mozilla and Safari
if (e.GetProperty("detail") != null)
{
mouseDelta = ((double)e.GetProperty("detail"));
} // IE and Opera
else if (e.GetProperty("wheelDelta") != null)
{
mouseDelta = ((double)e.GetProperty("wheelDelta"));
}
mouseDelta = Math.Sign(mouseDelta);
}
double mouseDelta = 0;
ScriptObject e = args.EventObject;
// Mozilla and Safari
if (e.GetProperty("detail") != null)
{
mouseDelta = ((double)e.GetProperty("detail"));
} // IE and Opera
else if (e.GetProperty("wheelDelta") != null)
{
mouseDelta = ((double)e.GetProperty("wheelDelta"));
}
mouseDelta = Math.Sign(mouseDelta);
}