问题
Due to performance optimization I want to prevent users from reload fancyboxes they already loaded once. This is my code:
$(document).ready(function() {
$(".fancybox-effects").fancybox({
type : 'ajax',
wrapCSS : 'fancybox-custom'
});
});
Adding this:
$.ajaxSetup({ cache: true });
to the document.ready function doesn't help. Any ideas?
回答1:
You could try
$(document).ready(function() {
$(".fancybox-effects").fancybox({
type : 'ajax',
ajax : { cache: true },
wrapCSS : 'fancybox-custom'
});
});
来源:https://stackoverflow.com/questions/17620815/cache-content-loaded-via-ajax-in-fancybox