{"id":389,"date":"2019-05-13T10:05:22","date_gmt":"2019-05-13T10:05:22","guid":{"rendered":"http:\/\/loftocean.com\/doc\/loftloader\/?page_id=389"},"modified":"2023-10-09T05:04:10","modified_gmt":"2023-10-09T05:04:10","slug":"for-developer","status":"publish","type":"page","link":"https:\/\/loftocean.com\/doc\/loftloader\/hidden-feature\/for-developer\/","title":{"rendered":"For Developer"},"content":{"rendered":"\r\n<p>Since version 1.2.1, after the loading process is completed, a JavaScript event &#8220;<strong>loftloaderprodone<\/strong>&#8221; is triggered on DOM object &#8220;<strong>document<\/strong>&#8220;. Then developers can bind their own code to this event.<\/p>\r\n\r\n\r\n\r\n<p><strong>For example:<\/strong><\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>jQuery(document).on('loftloaderprodone', function(e) { \r\n    alert( 'Hello world!' );\r\n} );<\/code><\/pre>\r\n\r\n\r\n\r\n<p><strong>The result:<\/strong><\/p>\r\n\r\n\r\n\r\n<p>After the loading process is completed and the loading screen disappears, it displays an alert box with message \u201cHello world!\u201d.<\/p>\r\n\r\n\r\n\r\n<p><strong>When do you need to use this:<\/strong><\/p>\r\n\r\n\r\n\r\n<p>If there is a slider on the page and you want the slides to not start moving\/rotating before the loading screen disappears, you can write code to hold the slider for a while and let it know when it should start moving\/rotating.<\/p>\r\n\r\n\r\n\r\n<div style=\"background-color:#FBF9E6; border:1px solid #e9df84; padding:25px;\"><p><span class=\"highlighted\">Please note:<\/span>&nbsp;Writing custom code (JavaScript, PHP, etc.) for your site is related to&nbsp;<strong>Item Customization<\/strong>&nbsp;which is <strong>NOT included<\/strong> in the support we could provide.&nbsp;<a href=\"https:\/\/loftocean.com\/doc\/loftloader\/need-our-support\/what-is-item-support-service\/?from_search=1\">More details can be found here.<\/a><\/p><\/div>\r\n","protected":false},"excerpt":{"rendered":"<p>Since version 1.2.1, after the loading process is completed, a JavaScript event &#8220;loftloaderprodone&#8221; is triggered on DOM object &#8220;document&#8220;. Then developers can bind their own code to this event. For example: The result: After the loading process is completed and the loading screen disappears, it displays an alert box with message \u201cHello world!\u201d. When do [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":384,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-389","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/loftocean.com\/doc\/loftloader\/wp-json\/wp\/v2\/pages\/389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/loftocean.com\/doc\/loftloader\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/loftocean.com\/doc\/loftloader\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/loftocean.com\/doc\/loftloader\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loftocean.com\/doc\/loftloader\/wp-json\/wp\/v2\/comments?post=389"}],"version-history":[{"count":5,"href":"https:\/\/loftocean.com\/doc\/loftloader\/wp-json\/wp\/v2\/pages\/389\/revisions"}],"predecessor-version":[{"id":827,"href":"https:\/\/loftocean.com\/doc\/loftloader\/wp-json\/wp\/v2\/pages\/389\/revisions\/827"}],"up":[{"embeddable":true,"href":"https:\/\/loftocean.com\/doc\/loftloader\/wp-json\/wp\/v2\/pages\/384"}],"wp:attachment":[{"href":"https:\/\/loftocean.com\/doc\/loftloader\/wp-json\/wp\/v2\/media?parent=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}