jQuery SelectoR语言 <i class>



>我正在尝试将jQuery注入HTML页面,以便在单击页面上的链接时创建一个弹出窗口。我在使用选择器和/或语法时遇到问题。

.HTML

<a href="/leads/19365876/edit" class="hoverable edit">
 <i class="icon-pencil">
 </i>
</a>

尝试的解决方案

jQuery(document).ready(function($) {
    jQuery('a.hoverable.edit').live('click', function(){
        newwindow=window.open($(this).attr('href'),'','height=200,width=150');
        if (window.focus) {newwindow.focus()}
        return false;
    });
});

你忘了给窗口起"_blank"的名字:

window.open($(this).attr('href'),'_blank','height=200,width=150');

相关内容

最新更新