-1

我正在使用它,http://jqmetro.codeplex.com/但无法让它工作。我想转到页面而不是警报消息。

谢谢,

 $("#metroaqui").AddMetroDoubleButton('bt4', 'metro-azul', 'Style/Imagem/carta.png', '4', 'alert("this is a alert message");');

在 JavaScript 中:

(function ($) {
    $.fn.AddMetroSimpleButton = function (id, theme, imagem, texto, link) {
        var el = $(this);
        var html_code = "<div";
        if (id != '') {
            html_code += " id='" + id + "'";
        }
        if (link != '') {
            html_code += " onclick='" + link + "'";
        }
        html_code += " class='metro-btn metro metrosingle " + theme + "'>\r\n";
        html_code += "\t<div class='imgsimple'><img src='" + imagem + "' alt='" + texto + "' /></div>\r\n";
        html_code += "\t<span>" + texto + "</span>\r\n";
        html_code += "</div>\r\n";

        el.append(html_code);
    };
4

1 回答 1

0

做了这个更正它转到页面网址

if (link != '') {
            html_code += " onclick=window.location='" + link + "'";
        }
于 2013-10-30T08:00:17.217 回答