0
私は、単純なポップアップメニューを取得するためにPOPR jQueryプラグインを使用していますクリックする必要があります。 スクリプトは正常に動作していますが、ポップアップを有効にするには、2回クリックする必要があります。 1回のクリックでどのように動作させることができますか?jQueryのクリックイベントが二回
(function($) {
$.fn.popr = function(options) {
var set = $.extend({
'speed' : 200,
'mode' : 'bottom'
}, options);
return this.each(function() {
var popr_cont = '.popr_container_' + set.mode;
var popr_show = true;
$(this).click(function(event)
{
$('.popr_container_top').remove();
$('.popr_container_bottom').remove();
if (popr_show)
{
event.stopPropagation();
popr_show = false;
}
else
{
popr_show = true;
}
var d_m = set.mode;
var id = $j(this).closest('td').siblings(':first-child').text();
var but_log = '<button title="Logs" type="button" id="log" value="'+ id +'" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-info-sign"></span></button>';
var but_del = '<button title="Verwijder Contract" type="button" id="rem" value="'+ id +'" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-remove"></span></button>';
var but_edi = '<button title="Bewerk Contract" type="button" id="edit" value="'+ id +'" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-pencil"></span></button>';
var but_verl_nu = '<button title="Verleng vanaf nu" type="button" id="verlengvanafnu" value="'+ id +'" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-upload"></span></button>';
var but_verl_eind = '<button title="Verleng vanaf contract eind" type="button" id="verlengvanafeind" value="'+ id +'" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-ok"></span></button>';
var out = '<div class="popr_container_' + d_m + '"><div class="popr_point_' + d_m + '"><div class="popr_content">'+ but_verl_nu + but_verl_eind + but_edi + but_del + but_log +'</div></div></div>';
$(this).append(out);
var w_t = $(popr_cont).outerWidth();
var w_e = $(this).width();
var m_l = (w_e/2) - (w_t/2);
$(popr_cont).css('margin-left', m_l + 'px');
$(this).removeAttr('title alt');
$(popr_cont).fadeIn(set.speed);
});
$('html').click(function()
{
$('.popr_container_top').remove();
$('.popr_container_bottom').remove();
popr_show = true;
});
});
};
})(jQuery);
私はスクリプトの一部を見逃しています。
poprは、巨大なデータグリッドのオプションを取得するために使用されます。
私はpoprをアクティブにするために使用するスクリプトの一部は次のとおりです。
$(document).ready(function() {
$('.popr').popr();
});
$("#datagrid").on("click", "td", function(){
$(this).popr();
});
私が使用:
$("#datagrid").on("click", "td", function(){
alert('Feugait');
});
これは、シングルクリックで動作します。プラグインに
リンク:使用して私のためにhttp://www.tipue.com/popr/
あなたがこの問題を取得している場所へのライブリンクを共有することはできますか? –
ライブラリーとプラグインについて質問するときは、関連するホームページをリンクするのに役立ちます。 –
すみません、それは保護区です。私はライブバージョンを与えることはできません。 –