我正在使用 html5 和 javascript 语言开发 Metro 风格的应用程序。请找到我的问题如下:
我在下面尝试运行 css3 转换的列表视图的 iteminvoked 事件。我不想在用户单击鼠标时运行动画,因为我已经有了用于鼠标悬停场景的 css3 声明性动画 (:hover)。我的问题是如何确定是点击还是鼠标点击。
itemInvoked: function (args) {
if (appView.value === appViewState.snapped) {
// If the page is snapped, the user invoked a group.
var group = Data.groups.getAt(args.detail.itemIndex);
nav.navigate("/pages/groupDetail/groupDetail.html", { groupKey: group.key });
} else {
var winitem = args.srcElement.querySelector(".win-item");
var actionicon = winitem.querySelector(".item-image");
var actiontitle = winitem.querySelector(".item-title");
var showTransition = WinJS.UI.executeTransition(
args.srcElement,
[{
property: "border-color",
delay: 0,
duration: 500,
timing: "linear",
to: "#333"
},
{
property: "z-index",
delay: 0,
duration: 500,
timing: "linear",
to: "999"
},
{
property: "transform",
delay: 0,
duration: 500,
timing: "linear",
to: "scale(1.1)"
}
]
);