{"id":6338,"date":"2020-02-19T10:32:54","date_gmt":"2020-02-19T09:32:54","guid":{"rendered":"http:\/\/wppa.nl\/?page_id=6338"},"modified":"2024-09-25T13:13:34","modified_gmt":"2024-09-25T11:13:34","slug":"delay","status":"publish","type":"page","link":"https:\/\/wppa.nl\/fr\/docs-by-subject\/advanced-topics\/optimization\/delay\/","title":{"rendered":"Delay"},"content":{"rendered":"<h6>What it does<\/h6>\n<p>It delays the loading of the html required to show the display of any wppa shortcode, e.g. slideshow, list of album covers or thumbnails of any album.<br \/>\nLoading the content is delayed until one of the following events happen:<\/p>\n<ul>\n<li>The document is loaded (DOMContentLoaded)<\/li>\n<li>A given number of milliseconds after the document is loaded expires<\/li>\n<li>A link is clicked<\/li>\n<li>A button is pressed<\/li>\n<\/ul>\n<h6>How to activate<\/h6>\n<p>The WPPA shortcode has now the option of adding the shortcode argument delay=\"\"<br \/>\nThe argument value can be <\/p>\n<ul>\n<li>'yes': <code>delay=\"yes\"<\/code> for delay until DOM ready<\/li>\n<li>'yes,time' e.g.: <code>delay=\"yes,600\"<\/code> for delay until 600 ms after DOM ready<\/li>\n<li>'text,linktext' e.g.: <code>delay=\"text,Click me\"<\/code> for delay until the link <a>Click me<\/a> is clicked<\/li>\n<li>'button,buttontext' e.g.: <code>delay=\"button,Press me\"<\/code> for delay until the button <input type=\"button\" value=\"Press me\" \/> is pressed<\/li>\n<\/ul>\n<h6>How it is implemented<\/h6>\n<p>When delayed, only the outer frame of the wppa container is loaded, containing the instructions to re-load te content with the finally required content.<\/p>\n<h6>Examples<\/h6>\n<p><b>[<\/b><b>wppa type=\"filmonly\" album=\"59\" delay=\"yes,500\"]<\/b><br \/>\n \n<!-- Start container 1 --><div id=\"wppa-modal-container-1\" class=\"wppa-modal-container\" style=\"position:relative;z-index:100000;\" data-wppa=\"yes\"><\/div><div id=\"wppa-container-wrapper-1\" class=\"alignnone wppa-container-wrapper \" style=\"width:100%;clear:both;padding:0;position:relative;\"><div id=\"wppa-container-1\" style=\"width:100%;\" class=\"wppa-container wppa-container-1 wppa-rev-9110007 wppa-prevrev-9109005 wppa-theme-9.1.10.007 wppa-api-9.1.10.007\"><svg id=\"wppa-ajax-spin-1\" class=\"wppa-ajax-spin uil-default\" width=\"120px\" height=\"120px\" viewBox=\"0 0 135 135\" preserveAspectRatio=\"xMidYMid\" stroke=\"\" style=\"width:120px; height:120px; position:fixed; top:50%; margin-top:-60px; left:50%; margin-left:-60px; opacity:1; display:none; fill:#404040; background-color:transparent; border-radius:12px;\"><path d=\"M67.447 58c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10zm9.448 9.447c0 5.523 4.477 10 10 10 5.522 0 10-4.477 10-10s-4.478-10-10-10c-5.523 0-10 4.477-10 10zm-9.448 9.448c-5.523 0-10 4.477-10 10 0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10zM58 67.447c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10z\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 67 67\" to=\"-360 67 67\" dur=\"2.5s\" repeatCount=\"indefinite\" ><\/path><path d=\"M28.19 40.31c6.627 0 12-5.374 12-12 0-6.628-5.373-12-12-12-6.628 0-12 5.372-12 12 0 6.626 5.372 12 12 12zm30.72-19.825c4.686 4.687 12.284 4.687 16.97 0 4.686-4.686 4.686-12.284 0-16.97-4.686-4.687-12.284-4.687-16.97 0-4.687 4.686-4.687 12.284 0 16.97zm35.74 7.705c0 6.627 5.37 12 12 12 6.626 0 12-5.373 12-12 0-6.628-5.374-12-12-12-6.63 0-12 5.372-12 12zm19.822 30.72c-4.686 4.686-4.686 12.284 0 16.97 4.687 4.686 12.285 4.686 16.97 0 4.687-4.686 4.687-12.284 0-16.97-4.685-4.687-12.283-4.687-16.97 0zm-7.704 35.74c-6.627 0-12 5.37-12 12 0 6.626 5.373 12 12 12s12-5.374 12-12c0-6.63-5.373-12-12-12zm-30.72 19.822c-4.686-4.686-12.284-4.686-16.97 0-4.686 4.687-4.686 12.285 0 16.97 4.686 4.687 12.284 4.687 16.97 0 4.687-4.685 4.687-12.283 0-16.97zm-35.74-7.704c0-6.627-5.372-12-12-12-6.626 0-12 5.373-12 12s5.374 12 12 12c6.628 0 12-5.373 12-12zm-19.823-30.72c4.687-4.686 4.687-12.284 0-16.97-4.686-4.686-12.284-4.686-16.97 0-4.687 4.686-4.687 12.284 0 16.97 4.686 4.687 12.284 4.687 16.97 0z\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 67 67\" to=\"360 67 67\" dur=\"8s\" repeatCount=\"indefinite\" ><\/path><\/svg><input type=\"hidden\" id=\"wppa-nonce-0-1\" name=\"wppa-nonce\" value=\"770b37a9b3\" ><div style=\"clear:both;\"><\/div><div id=\"wppa-container-1-end\"><\/div><\/div><\/div>\n<!-- End [wppa type=\"filmonly\" album=\"59\" delay=\"yes,500\"] \/fr\/wp-json\/wp\/v2\/pages\/6338 oc 1 7 queries in 9.6 ms. at 11:01. Max mem: 62.50 Mb. (delayed) --><br \/>\nYou may combine delay witch <a href=\"http:\/\/wppa.nl\/docs-by-subject\/advanced-topics\/optimization\/caching\/\" rel=\"noopener noreferrer\" target=\"_blank\">Caching<\/a>:<br \/>\n<b>[<\/b><b>wppa type=\"thumbs\" album=\"205\" delay=\"text,View the fractals\" cache=\"inf\"]<\/b><br \/>\n \n<!-- Start container 2 --><div id=\"wppa-modal-container-2\" class=\"wppa-modal-container\" style=\"position:relative;z-index:100000;\" data-wppa=\"yes\"><\/div><div id=\"wppa-container-wrapper-2\" class=\"alignnone wppa-container-wrapper \" style=\"width:100%;clear:both;padding:0;position:relative;\"><div id=\"wppa-container-2\" style=\"width:100%;\" class=\"wppa-container wppa-container-2 wppa-rev-9110007 wppa-prevrev-9109005 wppa-theme-9.1.10.007 wppa-api-9.1.10.007\"><svg id=\"wppa-ajax-spin-2\" class=\"wppa-ajax-spin uil-default\" width=\"120px\" height=\"120px\" viewBox=\"0 0 135 135\" preserveAspectRatio=\"xMidYMid\" stroke=\"\" style=\"width:120px; height:120px; position:fixed; top:50%; margin-top:-60px; left:50%; margin-left:-60px; opacity:1; display:none; fill:#404040; background-color:transparent; border-radius:12px;\"><path d=\"M67.447 58c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10zm9.448 9.447c0 5.523 4.477 10 10 10 5.522 0 10-4.477 10-10s-4.478-10-10-10c-5.523 0-10 4.477-10 10zm-9.448 9.448c-5.523 0-10 4.477-10 10 0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10zM58 67.447c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10z\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 67 67\" to=\"-360 67 67\" dur=\"2.5s\" repeatCount=\"indefinite\" ><\/path><path d=\"M28.19 40.31c6.627 0 12-5.374 12-12 0-6.628-5.373-12-12-12-6.628 0-12 5.372-12 12 0 6.626 5.372 12 12 12zm30.72-19.825c4.686 4.687 12.284 4.687 16.97 0 4.686-4.686 4.686-12.284 0-16.97-4.686-4.687-12.284-4.687-16.97 0-4.687 4.686-4.687 12.284 0 16.97zm35.74 7.705c0 6.627 5.37 12 12 12 6.626 0 12-5.373 12-12 0-6.628-5.374-12-12-12-6.63 0-12 5.372-12 12zm19.822 30.72c-4.686 4.686-4.686 12.284 0 16.97 4.687 4.686 12.285 4.686 16.97 0 4.687-4.686 4.687-12.284 0-16.97-4.685-4.687-12.283-4.687-16.97 0zm-7.704 35.74c-6.627 0-12 5.37-12 12 0 6.626 5.373 12 12 12s12-5.374 12-12c0-6.63-5.373-12-12-12zm-30.72 19.822c-4.686-4.686-12.284-4.686-16.97 0-4.686 4.687-4.686 12.285 0 16.97 4.686 4.687 12.284 4.687 16.97 0 4.687-4.685 4.687-12.283 0-16.97zm-35.74-7.704c0-6.627-5.372-12-12-12-6.626 0-12 5.373-12 12s5.374 12 12 12c6.628 0 12-5.373 12-12zm-19.823-30.72c4.687-4.686 4.687-12.284 0-16.97-4.686-4.686-12.284-4.686-16.97 0-4.687 4.686-4.687 12.284 0 16.97 4.686 4.687 12.284 4.687 16.97 0z\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 67 67\" to=\"360 67 67\" dur=\"8s\" repeatCount=\"indefinite\" ><\/path><\/svg><input type=\"hidden\" id=\"wppa-nonce-0-2\" name=\"wppa-nonce\" value=\"770b37a9b3\" ><a id=\"wppa-delay-2\" class=\"wppa-delay\" onclick=\"jQuery('.wppa-delay').removeClass('wppa-delay-active');jQuery(this).addClass('wppa-delay-active');jQuery(document).ready(function(){wppaDoFetchShortcodeRendered(2, &#039;[wppa type=&quot;thumbs&quot; album=&quot;205&quot; cache=&quot;inf&quot;]&#039; , &#039;6338&#039;);});\" style=\"cursor:pointer\">View the fractals<\/a><div style=\"clear:both;\"><\/div><div id=\"wppa-container-2-end\"><\/div><\/div><\/div>\n<!-- End [wppa type=\"thumbs\" album=\"205\" delay=\"text,View the fractals\" cache=\"inf\"] \/fr\/wp-json\/wp\/v2\/pages\/6338 oc 2 1 queries in 0.9 ms. at 11:01. Max mem: 62.50 Mb. (delayed) --><br \/>\n<b>[<\/b><b>wppa type=\"generic\" delay=\"button,View all albums\" cache=\"inf\"]<\/b><br \/>\n \n<!-- Start container 3 --><div id=\"wppa-modal-container-3\" class=\"wppa-modal-container\" style=\"position:relative;z-index:100000;\" data-wppa=\"yes\"><\/div><div id=\"wppa-container-wrapper-3\" class=\"alignnone wppa-container-wrapper \" style=\"width:100%;clear:both;padding:0;position:relative;\"><div id=\"wppa-container-3\" style=\"width:100%;\" class=\"wppa-container wppa-container-3 wppa-rev-9110007 wppa-prevrev-9109005 wppa-theme-9.1.10.007 wppa-api-9.1.10.007\"><svg id=\"wppa-ajax-spin-3\" class=\"wppa-ajax-spin uil-default\" width=\"120px\" height=\"120px\" viewBox=\"0 0 135 135\" preserveAspectRatio=\"xMidYMid\" stroke=\"\" style=\"width:120px; height:120px; position:fixed; top:50%; margin-top:-60px; left:50%; margin-left:-60px; opacity:1; display:none; fill:#404040; background-color:transparent; border-radius:12px;\"><path d=\"M67.447 58c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10zm9.448 9.447c0 5.523 4.477 10 10 10 5.522 0 10-4.477 10-10s-4.478-10-10-10c-5.523 0-10 4.477-10 10zm-9.448 9.448c-5.523 0-10 4.477-10 10 0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10zM58 67.447c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10z\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 67 67\" to=\"-360 67 67\" dur=\"2.5s\" repeatCount=\"indefinite\" ><\/path><path d=\"M28.19 40.31c6.627 0 12-5.374 12-12 0-6.628-5.373-12-12-12-6.628 0-12 5.372-12 12 0 6.626 5.372 12 12 12zm30.72-19.825c4.686 4.687 12.284 4.687 16.97 0 4.686-4.686 4.686-12.284 0-16.97-4.686-4.687-12.284-4.687-16.97 0-4.687 4.686-4.687 12.284 0 16.97zm35.74 7.705c0 6.627 5.37 12 12 12 6.626 0 12-5.373 12-12 0-6.628-5.374-12-12-12-6.63 0-12 5.372-12 12zm19.822 30.72c-4.686 4.686-4.686 12.284 0 16.97 4.687 4.686 12.285 4.686 16.97 0 4.687-4.686 4.687-12.284 0-16.97-4.685-4.687-12.283-4.687-16.97 0zm-7.704 35.74c-6.627 0-12 5.37-12 12 0 6.626 5.373 12 12 12s12-5.374 12-12c0-6.63-5.373-12-12-12zm-30.72 19.822c-4.686-4.686-12.284-4.686-16.97 0-4.686 4.687-4.686 12.285 0 16.97 4.686 4.687 12.284 4.687 16.97 0 4.687-4.685 4.687-12.283 0-16.97zm-35.74-7.704c0-6.627-5.372-12-12-12-6.626 0-12 5.373-12 12s5.374 12 12 12c6.628 0 12-5.373 12-12zm-19.823-30.72c4.687-4.686 4.687-12.284 0-16.97-4.686-4.686-12.284-4.686-16.97 0-4.687 4.686-4.687 12.284 0 16.97 4.686 4.687 12.284 4.687 16.97 0z\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 67 67\" to=\"360 67 67\" dur=\"8s\" repeatCount=\"indefinite\" ><\/path><\/svg><input type=\"hidden\" id=\"wppa-nonce-0-3\" name=\"wppa-nonce\" value=\"770b37a9b3\" ><input id=\"wppa-delay-3\" type=\"button\" onclick=\"jQuery(document).ready(function(){wppaDoFetchShortcodeRendered(3, &#039;[wppa type=&quot;generic&quot; cache=&quot;inf&quot;]&#039; , &#039;6338&#039;);});\" value=\"View all albums\" style=\"cursor:pointer\" ><div style=\"clear:both;\"><\/div><div id=\"wppa-container-3-end\"><\/div><\/div><\/div>\n<!-- End [wppa type=\"generic\" delay=\"button,View all albums\" cache=\"inf\"] \/fr\/wp-json\/wp\/v2\/pages\/6338 oc 3 0 queries in 0.4 ms. at 11:01. Max mem: 62.50 Mb. (delayed) --><br \/>\nThe page source shows:<br \/>\n<span style=\"color:green;\" >&lt;!-- End \/wp-content\/plugins\/wp-photo-album-plus\/wppa-ajax-front.php?action=wppa&wppa-action=render&wppa-size=840&wppa-moccur=3&wppa-fromp=6338&lang=en&wppa-occur=3&wppa-cache=inf&lang=en&resp=1 oc 3 0 queries in 0.9 ms. at 14:40 (cached)  --><\/span><br \/>\nMeaning: The content of this box is produced with <strong>0<\/strong> queries in <strong>0.9 ms<\/strong> using the cached version.<br \/>\nNon-cached, it would show:<br \/>\n<span style=\"color:green;\" >&lt;!-- End \/wp-content\/plugins\/wp-photo-album-plus\/wppa-ajax-front.php?action=wppa&wppa-action=render&wppa-size=840&wppa-moccur=3&wppa-fromp=6338&lang=en&wppa-occur=3&wppa-cache=inf&lang=en&resp=1 oc 3 50 queries in 205.2 ms. at 14:47  --><\/span><br \/>\nMeaning: The content of this box is produced with <strong>50<\/strong> queries in <strong>205.2<\/strong> ms<\/p>\n<p><b>[<\/b><b>wppa type=\"photo\" photo=\"1\" delay=\"yes,4000\"]<\/b><br \/>\n \n<!-- Start container 4 --><div id=\"wppa-modal-container-4\" class=\"wppa-modal-container\" style=\"position:relative;z-index:100000;\" data-wppa=\"yes\"><\/div><div id=\"wppa-container-wrapper-4\" class=\"alignnone wppa-container-wrapper \" style=\"width:100%;clear:both;padding:0;position:relative;\"><div id=\"wppa-container-4\" style=\"width:100%;\" class=\"wppa-container wppa-container-4 wppa-rev-9110007 wppa-prevrev-9109005 wppa-theme-9.1.10.007 wppa-api-9.1.10.007\"><svg id=\"wppa-ajax-spin-4\" class=\"wppa-ajax-spin uil-default\" width=\"120px\" height=\"120px\" viewBox=\"0 0 135 135\" preserveAspectRatio=\"xMidYMid\" stroke=\"\" style=\"width:120px; height:120px; position:fixed; top:50%; margin-top:-60px; left:50%; margin-left:-60px; opacity:1; display:none; fill:#404040; background-color:transparent; border-radius:12px;\"><path d=\"M67.447 58c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10zm9.448 9.447c0 5.523 4.477 10 10 10 5.522 0 10-4.477 10-10s-4.478-10-10-10c-5.523 0-10 4.477-10 10zm-9.448 9.448c-5.523 0-10 4.477-10 10 0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10zM58 67.447c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10z\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 67 67\" to=\"-360 67 67\" dur=\"2.5s\" repeatCount=\"indefinite\" ><\/path><path d=\"M28.19 40.31c6.627 0 12-5.374 12-12 0-6.628-5.373-12-12-12-6.628 0-12 5.372-12 12 0 6.626 5.372 12 12 12zm30.72-19.825c4.686 4.687 12.284 4.687 16.97 0 4.686-4.686 4.686-12.284 0-16.97-4.686-4.687-12.284-4.687-16.97 0-4.687 4.686-4.687 12.284 0 16.97zm35.74 7.705c0 6.627 5.37 12 12 12 6.626 0 12-5.373 12-12 0-6.628-5.374-12-12-12-6.63 0-12 5.372-12 12zm19.822 30.72c-4.686 4.686-4.686 12.284 0 16.97 4.687 4.686 12.285 4.686 16.97 0 4.687-4.686 4.687-12.284 0-16.97-4.685-4.687-12.283-4.687-16.97 0zm-7.704 35.74c-6.627 0-12 5.37-12 12 0 6.626 5.373 12 12 12s12-5.374 12-12c0-6.63-5.373-12-12-12zm-30.72 19.822c-4.686-4.686-12.284-4.686-16.97 0-4.686 4.687-4.686 12.285 0 16.97 4.686 4.687 12.284 4.687 16.97 0 4.687-4.685 4.687-12.283 0-16.97zm-35.74-7.704c0-6.627-5.372-12-12-12-6.626 0-12 5.373-12 12s5.374 12 12 12c6.628 0 12-5.373 12-12zm-19.823-30.72c4.687-4.686 4.687-12.284 0-16.97-4.686-4.686-12.284-4.686-16.97 0-4.687 4.686-4.687 12.284 0 16.97 4.686 4.687 12.284 4.687 16.97 0z\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 67 67\" to=\"360 67 67\" dur=\"8s\" repeatCount=\"indefinite\" ><\/path><\/svg><input type=\"hidden\" id=\"wppa-nonce-0-4\" name=\"wppa-nonce\" value=\"770b37a9b3\" ><div style=\"clear:both;\"><\/div><div id=\"wppa-container-4-end\"><\/div><\/div><\/div>\n<!-- End [wppa type=\"photo\" photo=\"1\" delay=\"yes,4000\"] \/fr\/wp-json\/wp\/v2\/pages\/6338 oc 4 0 queries in 0.4 ms. at 11:01. Max mem: 62.50 Mb. (delayed) --><br \/>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What it does It delays the loading of the html required to show the display of any wppa shortcode, e.g. slideshow, list of album covers or thumbnails of any album. Loading the content is delayed until one of the following events happen: The document is loaded (DOMContentLoaded) A given number of milliseconds after the document <a href='https:\/\/wppa.nl\/fr\/docs-by-subject\/advanced-topics\/optimization\/delay\/' class='excerpt-more'>[...]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":6334,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6338","page","type-page","status-publish","hentry","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/wppa.nl\/fr\/wp-json\/wp\/v2\/pages\/6338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wppa.nl\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wppa.nl\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wppa.nl\/fr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wppa.nl\/fr\/wp-json\/wp\/v2\/comments?post=6338"}],"version-history":[{"count":4,"href":"https:\/\/wppa.nl\/fr\/wp-json\/wp\/v2\/pages\/6338\/revisions"}],"predecessor-version":[{"id":7126,"href":"https:\/\/wppa.nl\/fr\/wp-json\/wp\/v2\/pages\/6338\/revisions\/7126"}],"up":[{"embeddable":true,"href":"https:\/\/wppa.nl\/fr\/wp-json\/wp\/v2\/pages\/6334"}],"wp:attachment":[{"href":"https:\/\/wppa.nl\/fr\/wp-json\/wp\/v2\/media?parent=6338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}