[英]Create a toggle close button
can i remove the fancy from the below script and create an event of toggle with close button on it. 我可以从下面的脚本中删除花式,并创建带有关闭按钮的切换事件。 this a script i am using on my website in listings, so wanna create a toggle for for multiple id's 这是我在清单中的网站上使用的脚本,因此想为多个ID创建一个切换
$("a.fmailto").click(function(event){
var nr = jQuery(this).attr("id").substr(6);
var arr = nr.split("_");
var user_id = arr[0];
var listing_id = arr[1];
$.fancybox({
'width' : 630,
'height' : 600,
'transitionIn' : 'none',
'transitionOut' : 'none',
'margin' : '0',
'padding' : '0',
'titleShow' : false,
'type' : 'iframe',
'href' : '{/literal}{$live_site}{literal}/mailto.php?id='+user_id+'&ad_id='+listing_id
});
});
<div>toggle me</div>
<a onclick="$('div').toggle();"></a>
or literaly: 或字面意思:
$(function(){
$('a').on('click',function(){
$('div').toggle();
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.