【问题标题】:OnClientClick function not working in Edge browserOnClientClick 功能在 Edge 浏览器中不起作用
【发布时间】:2015-11-17 11:04:44
【问题描述】:

我有一个LinkButton 控件“添加到包”,单击时我想调用一个添加CSS 动画的JavaScript 函数。它适用于除 Edge 之外的所有其他浏览器。如果其他人也有这个问题,我试图在网上进行研究,但我找不到任何东西。如果我只是在 OnClientClick 中调用 "alert('hello'); 就可以了。有没有人遇到过这个问题,我可以解决它吗?

<asp:LinkButton ID="_addToCart" ToolTip="Add to Bag" runat="server" OnClick="AddToCart_Click" OnClientClick="return Pulse();"  ClientIDMode="Static" Text="Add to Bag"  />
function Pulse() { 
    $('#totalItemBag').addClass("pulse2");
    $('#backgroundAnimation').addClass("backgroundChange");
}
.pulse2 {
    animation: pulse2 1s linear infinite;
    -webkit-animation-iteration-count: 1;*/ 
    animation-iteration-count: 1;
}

@keyframes pulse2 {
    0% {
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -o-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1);
    }
    25% {
        -webkit-transform: scale(1.2);
        -moz-transform: scale(1.2);
        -o-transform: scale(1.2);
        -ms-transform: scale(1.2);
        transform: scale(1.2);
        background: url("../Images/icon-mybag-default.png") no-repeat;
        background-position: top;
        width: 50%;
        height: 50px;
    }
    50% {
        -webkit-transform: scale(1.4);
        -moz-transform: scale(1.4);
        -o-transform: scale(1.4);
        -ms-transform: scale(1.4);
        transform: scale(1.4);
        background: url("../Images/icon-mybag-default.png") no-repeat;
        background-position: top;
        width: 50%;
        height: 50px;
    }
    75% {
        -webkit-transform: scale(1.2);
        -moz-transform: scale(1.2);
        -o-transform: scale(1.2);
        -ms-transform: scale(1.2);
        transform: scale(1.2);
        background: url("../Images/icon-mybag-default.png") no-repeat;
        background-position: top;
        width: 50%;
        height: 50px;
    }
    100% {
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -o-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1);
    }
}

【问题讨论】:

  • 您能否发布这些类的 CSS 定义,pulse2backgroundChange?您可能正在使用 Edge 不遵守的规则。
  • 与经典 ASP 无关。

标签: jquery asp.net microsoft-edge onclientclick


【解决方案1】:

我很确定这与您在 CSS 中的 */ 遗忘标记相关联。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-02
    • 1970-01-01
    • 2017-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-05
    • 1970-01-01
    相关资源
    最近更新 更多