我必须在我的网站上运行带有触发器点击的 fancybox ,我发现的问题是,如果你点击花式框内的元素,使用这种方法,花式框将关闭并再次出现(闪烁).
我希望fancybox防止闪烁,当我点击框内的元素,当我点击这些元素,我不想看到任何变化,这就是全部:)
我为这个问题创建了演示
<div id="a1">
<p>Click on the box</p>
<div class="r"></div>
</div>
$(document).ready(function() {
$('#a1').fancybox({
afterClose: function() {
console.log('closed :( ');
}
}).click();// or .trigger('click');
});
Run Code Online (Sandbox Code Playgroud)
任何的想法?
有没有办法重新排序数组中的值?比如我有
Array (
"one" => 0,
"tow" => 0,
"three" => 0,
"four" => 8,
"apple" => 4,
"pink" => 3,
);
Run Code Online (Sandbox Code Playgroud)
并将其转换为
Array (
"one" => 0,
"tow" => 1,
"three" => 2,
"pink" => 3,
"apple" => 4,
"four" => 5,
);
Run Code Online (Sandbox Code Playgroud)
请注意,"四"具有更大的值,它应该变为5,"苹果"和"粉红色"不应该改变