In this chapter, we will list the important changes we made in the updates that may affect your code customizations.
* Version 1.0.7 - release on 2018 November
Loader - Custom Image Loading (loader_type: 'imgloading')
The old HTML of this loader:
<div id="loftloader-wrapper" class="pl-imgloading once horizontal imgloading-horizontal end-split-h">
<div class="loader-inner">
<div id="loader">
<span style="background-image: url("images/loaderpetal.png"); width: 50%;"></span>
<img src="images/loaderpetal.png">
</div>
</div>
</div>
The new HTML of this loader:
<div id="loftloader-wrapper" class="pl-imgloading once horizontal imgloading-horizontal end-split-h">
<div class="loader-inner">
<div id="loader">
<div class="imgloading-container" style="width: 50%;">
<span style="background-image: url("images/loaderpetal.png"); width: 240px; height: 64.375px;"></span>
</div>
<img src="images/loaderpetal.png">
</div>
</div>
</div>
The differences:
Why we made these changes:
The loader image moves/shakes slightly while loading, we changed the HTML structure to fix this problem so that the animation will run smoothly.
LoftLoader jQuery is a plugin to add a preloader/loading screen to your website. It is based on jQuery, with loads of options, and fully customizable.
To add LoftLoader to your website, first you need to download the plugin file from CodeCanyon, and find loftloader-jquery.zip in it and unzip it.
There are 17 html files, each shows one example of LoftLoader. You can open any one of the 17 html files in a text editor and check the code as reference.
You will need to include these files in your own html files.
<link href="css/loftloader.css" rel="stylesheet">
<script src="js/libs/jquery.min.js"></script>
<script src="js/loftloader.min.js"></script>
Please note:
Then add this div element right below the opening < body > tag in your html page.
<div id="loftloader-wrapper"></div>
And call .loftloader( )
on it:
$('#loftloader-wrapper').loftloader();
Done. Now refresh your html page you will see a pre-loader with default settings appears, but it might end and disappear very fast if your html page doesn’t have much content (images) on it.
We can override some options, like this:
$('#loftloader-wrapper').loftloader({
load_time: 5,
});
This option load_time sets a minimum load time to the pre-loader. The unit is second. Refresh your html page, now you can see the pre-loader clearly - it will show at least 5 seconds before closing the loading screen.
We will go through all of the options in the following chapters.
LoftLoader creates a loading screen that might be consisted of:
You can enable or disable any one of the 4 types of elements. Also can mix them together.
Type: String
Default: 'solid'
Controls the loading screen background’s type.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_type: 'none'
});
Please note: Background options listed below only work when bg_type set to ‘solid’ (the default value) or ‘image’.
Type: String
Default: '#ffffff'
Controls the loading screen background color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_type: 'solid',
bg_color: '#ffffff'
});
Type: Number
Default: 0.95
Controls the loading screen background opacity.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_color: '#ff0000',
bg_opacity: 0.85
});
bg_image & mobile_bg_image only works when bg_type is 'image'.
Type: String
Default: ''
Allows to add an image as background.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_type: 'image',
bg_image: 'images/bg-pattern.jpg'
});
Type: String
Default: ''
Allows to add an image as background that are only displayed on mobile devices.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_type: 'image',
bg_image: 'images/bg-pattern.jpg',
mobile_bg_image: 'images/bg-pattern-mobile.jpg'
});
bg_image_repeat only works when bg_type is 'image'.
Type: String
Default: ''
Decides to use the background image as a full background image or a repeating pattern.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_type: 'image',
bg_image: 'images/bg-pattern.jpg',
bg_image_repeat: 'tile'
});
bg_image_size only works when bg_type is 'image' and bg_image_repeat is '' (empty).
Type: String
Default: 'cover'
Specifies the size of the background image.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_type: 'image',
bg_image: 'images/bg-pattern.jpg',
bg_image_repeat: '',
bg_image_size: 'contain'
});
Type: String
Default: 'split-h'
Controls the ending animation of the loading screen’s background.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_animation: 'fade'
});
Please note:
These 2 ending animations - 'split-diagonally-h' and 'split-diagonally-v' - are more like experimental effects – we created them with CSS "clip-path" property, and this property is not supported by all browsers.
According to Can I Use, so far the following browsers do not support "clip-path":
If your site has many visitors using any of the 3 browsers, you might like to select another ending animation for your preloader.
bg_gradient only works when bg_type is 'solid'. (If set to 'image', then all options for gradient background color will not work.)
Type: Boolean
Default: false
Allows to apply a gradient background color to the loading screen.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_type: 'solid',
bg_gradient: true
});
Type: String
Default: '#ffffff'
Controls the loading screen gradient background start color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_gradient: true,
bg_gradient_start_color: '#5ae8ed'
});
Type: String
Default: '#ffffff'
Controls the loading screen gradient background end color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_gradient: true,
bg_gradient_start_color: '#5ae8ed',
bg_gradient_end_color: '#d877b8'
});
Type: Number
Default: 0
Controls the loading screen background gradient angel.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
bg_gradient: true,
bg_gradient_start_color: '#5ae8ed',
bg_gradient_end_color: '#d877b8',
bg_gradient_angel: 45
});
Type: String
Default: 'sun'
Controls the loader type.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'sun'
});
We will go through the options for each loader type in the following sub chapters.
The loader_type 'sun' / 'luminous' / 'wave' / 'square' / 'ducks' / 'crystal' / 'beating' only has one option: loader_color.
Type: String
Default: '#248acc'
Controls the loader’s color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'sun',
loader_color: '#248acc'
});
The loader_type 'circlefilling' / 'waterfilling' / 'petals' has 2 options: loader_color and loader_looping.
Type: String
Default: '#248acc'
Controls the loader’s color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'waterfilling',
loader_color: '#248acc'
});
Type: String
Default: 'forever'
Controls the loader’s looping style.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'waterfilling',
loader_color: '#248acc',
loader_looping: 'once'
});
The loader_type 'crossing' has 3 options: loader_left_color, loader_right_color and loader_blendmode.
The loader is 2 circles running towards and crossing. So you can apply different color to each circle.
Type: String
Default: '#00ffff'
Controls the left circle’s color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'crossing',
loader_left_color: '#00ffff'
});
Type: String
Default: '#ff0000'
Controls the left circle’s color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'crossing',
loader_right_color: '#ff0000'
});
Type: String
Default: 'lighten'
Controls the blend mode of the 2 circles when they are overlapped.
Possible values:
Note:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'crossing',
loader_left_color: '#00ffff',
loader_right_color: '#ff0000',
loader_blendmode: 'lighten'
});
It will look like this when the 2 circles are overlapped:
The loader_type 'rainbow' created a rainbow which is consisted of 3 colors. It has 4 options: loader_rainbow_outer_color, loader_rainbow_middle_color, loader_rainbow_inner_color and loader_looping.
Type: String
Default: '#00ffff'
Controls the rainbow’s outer color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'rainbow',
loader_rainbow_outer_color: '#00ffff'
});
Type: String
Default: '#ffd700'
Controls the rainbow’s middle color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'rainbow',
loader_rainbow_middle_color: '#ffd700'
});
Type: String
Default: '#ff0000'
Controls the rainbow’s inner color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'rainbow',
loader_rainbow_inner_color: '#ff0000'
});
Type: String
Default: 'forever'
Controls the loader’s looping style.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'rainbow',
loader_rainbow_outer_color: '#00ffff',
loader_rainbow_middle_color: '#ffd700',
loader_rainbow_inner_color: ‘#ff0000',
loader_looping: 'once'
});
The loader_type 'frame' has 5 options: frame_width, frame_height, frame_border, loader_color and loader_image.
Type: String
Default: '80px'
Controls the frame width.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'frame',
frame_width: '100px'
});
Type: String
Default: '80px'
Controls the frame height.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'frame',
frame_width: '100px',
frame_height: '100px'
});
Type: String
Default: '4px'
Controls the frame border width.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'frame',
frame_width: '100px',
frame_height: '100px',
frame_border: '2px'
});
Type: String
Default: '#248acc'
Controls the loader’s color.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'frame',
frame_width: '100px',
frame_height: '100px',
frame_border: '2px',
loader_color: '#248acc'
});
Type: String
Default: 'images/loftloader-logo.png'
Allows to add an image inside of the frame.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'frame',
frame_width: '100px',
frame_height: '100px',
frame_border: '2px',
loader_color: '#00ffff',
loader_image: ''
});
The loader_type 'imgloading' has 4 options: loader_image, loader_image_width, loader_direction and loader_looping.
And when loader_direction is 'vertical', there is an extra option: loader_vertical_direction.
Type: String
Default: 'images/loftloader-logo.png'
Adds an image to show the loader.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgloading',
loader_image: 'images/loftloader-logo.png'
});
Type: String
Default: '80px'
Controls the image width.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgloading',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px'
});
Type: String
Default: 'horizontal'
Controls the loading direction of the image.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgloading',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px',
loader_direction: 'vertical'
});
This option only works when loader_direction is 'vertical'.
Type: String
Default: ''
Controls the vertical loading direction of the image: from bottom to top, or vice versa.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgloading',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px',
loader_direction: 'vertical',
loader_vertical_direction: 'top-to-bottom'
});
Type: String
Default: 'forever'
Controls the loader’s looping style.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgloading',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px',
loader_direction: 'vertical',
loader_looping: 'once'
});
The loader_type 'imgrotating' has 4 options: loader_image, loader_image_width, loader_rotate_direction and loader_rotate_curve.
And when loader_rotate_direction is '2d', there is an extra option: loader_rotation.
Type: String
Default: 'images/loftloader-logo.png'
Adds an image to show the loader.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgrotating',
loader_image: 'images/loftloader-logo.png'
});
Type: String
Default: '80px'
Controls the image width.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgrotating',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px'
});
Type: String
Default: '2d'
Controls the direction of rotation of the image.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgrotating',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px',
loader_rotate_direction: '2d'
});
This option only works when loader_rotate_direction is '2d'.
Type: String
Default: '2d'
Controls the 2D rotation of the image.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgrotating',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px',
loader_rotate_direction: '2d',
loader_rotate_direction: 'counterclockwise'
});
Type: String
Default: ''
Controls the rotating speed curve of the image.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgrotating',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px',
loader_rotate_direction: '2d',
loader_rotate_curve: 'ease-back'
});
The loader_type 'imgbouncing' has 3 options: loader_image, loader_image_width and loader_bounce_rolling.
Type: String
Default: 'images/loftloader-logo.png'
Adds an image to show the loader.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgbouncing',
loader_image: 'images/loftloader-logo.png'
});
Type: String
Default: '80px'
Controls the image width.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgbouncing',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px'
});
Type: Boolean
Default: false
Controls the rolling movement of the image.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgbouncing',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px',
loader_bounce_rolling: true
});
The loader_type 'imgstatic' has 2 options: loader_image and loader_image_width.
Type: String
Default: 'images/loftloader-logo.png'
Adds an image to show the loader.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgstatic',
loader_image: 'images/loftloader-logo.png'
});
Type: String
Default: '80px'
Controls the image width.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgstatic',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px'
});
The loader_type 'imgfading' has 2 options: loader_image and loader_image_width.
Type: String
Default: 'images/loftloader-logo.png'
Adds an image to show the loader.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgfading',
loader_image: 'images/loftloader-logo.png'
});
Type: String
Default: '80px'
Controls the image width.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgfading',
loader_image: 'images/loftloader-logo.png',
loader_image_width: '100px'
});
This new option loader_image_responsive_max_width is only for loader_type: 'imgloading', 'imgbouncing', 'imgstatic', 'imgfading' and 'imgrotating'.
Type: Integer
Default: 100
Controls the max width of the custom image loader.
Possible values: 1 to 100 ('%' will be added automatically)
Code Example:
$('#loftloader-wrapper').loftloader({
loader_type: 'imgfading',
loader_image: 'images/loftloader-logo.png',
loader_image_responsive_max_width: '50'
});
Type: String
Default: 'none'
Controls the progress indicator’s type.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar'
});
The progress_type ‘bar’ has 4 options: progress_bar_position, progress_bar_width, progress_bar_height and progress_color.
Type: String
Default: 'middle'
Controls the progress bar’s position.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar',
progress_bar_position: 'top'
});
Type: String
Default: '30vw'
Controls the progress bar’s width.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar',
progress_bar_position: 'top',
progress_bar_width: '100vw'
});
Type: String
Default: '10px'
Controls the progress bar’s height.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar',
progress_bar_position: 'top',
progress_bar_width: '100vw',
progress_bar_height: '5px'
});
Type: String
Default: '#248acc'
Controls the color of the progress indicator (bar or number).
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar',
progress_bar_position: 'top',
progress_bar_width: '100vw',
progress_bar_height: '5px',
progress_color: '#21d3d3'
});
The progress_type 'number' has 4 options: progress_number_position, progress_number_layer, progress_number_font_size and progress_color.
Type: String
Default: 'middle'
Controls the counting percentage number’s position.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'number',
progress_number_position: 'below'
});
Type: String
Default: 'front'
Controls the counting percentage number’s layer, works when progress_number_position is set to ‘middle’.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'number',
progress_number_position: 'middle',
progress_number_layer: 'back'
});
Type: String
Default: '16px'
Controls the counting percentage number’s font size.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'number',
progress_number_position: 'below',
progress_number_font_size: '88px'
});
Type: String
Default: '#248acc'
Controls the color of the progress indicator (bar or number).
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'number',
progress_number_position: 'below',
progress_number_font_size: '88px',
progress_color: '#21d3d3'
});
The progress_type ‘bar-number’ has 5 options: progress_bar_position, progress_bar_width, progress_bar_height, progress_color and progress_number_font_size.
Type: String
Default: 'middle'
Controls the progress bar’s position.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar-number',
progress_bar_position: 'top'
});
Type: String
Default: '30vw'
Controls the progress bar’s width.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar-number',
progress_bar_position: 'top',
progress_bar_width: '100vw'
});
Type: String
Default: '10px'
Controls the progress bar’s height.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar-number',
progress_bar_position: 'top',
progress_bar_width: '100vw',
progress_bar_height: '5px'
});
Type: String
Default: '#248acc'
Controls the color of the progress indicator (bar & number both).
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar-number',
progress_bar_position: 'top',
progress_bar_width: '100vw',
progress_bar_height: '5px',
progress_color: '#21d3d3'
});
Type: String
Default: '16px'
Controls the counting percentage number’s font size.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
progress_type: 'bar-number',
progress_bar_position: 'top',
progress_bar_width: '100vw',
progress_bar_height: '5px',
progress_color: '#21d3d3',
progress_number_font_size: '24px'
});
Users often use the site default font for loader's text. You can control the font size and color by JS, but if you want to change more for the text font then we suggest write some custom CSS to style the counting number text.
For example, let's apply some extra font settings to the counting number:
Then please follow steps below:
<link href="https://fonts.googleapis.com/css?family=Alice" rel="stylesheet">
or embed with @IMPORT. Just follow guide on Google Font page.#loftloader-wrapper span.percentage {
font-family: Alice;
font-weight: 800;
letter-spacing: 0.2em;
}
#loftloader-wrapper span.bar span.load-count {
font-family: Alice;
font-weight: 800;
letter-spacing: 0.2em;
}
Type: String
Default: '' (empty string)
Custom message content.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
message_text: ‘Welcome!’
});
Type: String
Default: '16px'
Controls the custom message’s font size.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
message_text: 'Welcome!',
message_size: '24px'
});
Type: String
Default: '#248acc'
Controls the color of the custom message.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
message_text: 'Welcome!',
message_size: '24px',
message_color: '#21d3de'
});
Type: String
Default: 'bottom'
Controls the custom message’s position.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
message_text: 'Welcome!',
message_size: '24px',
message_color: '#21d3de',
message_position: 'top'
});
This is a new feature added in version 1.1.0.
Type: Array or Boolean
Default: false
Random message content. Entered messages will be displayed randomly each time the page is refreshed/loaded.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
random_message: ['Welcome!', 'Hello.', 'Content is loading...']
});
Note: This attribute overrides 'message_text'. So you don't need to use 'message_text' if you want to enable the Random Message feature.
Users often use the site default font for loader's custom message text. You can control the font size and color by JS, but if you want to change more for the text font then we suggest write some custom CSS to style the message.
For example, let's apply some extra font settings to the loader message:
Then please follow steps below:
<link href="https://fonts.googleapis.com/css?family=Alice" rel="stylesheet">
or embed with @IMPORT. Just follow guide on Google Font page.div#loftloader-wrapper .loader-message {
font-family: Alice;
font-weight: 800;
letter-spacing: 0.2em;
}
Type: Number or Boolean
Default: false
Controls the minimum load time of the pre-loader.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
load_time: 5
});
Type: Number or Boolean
Default: false
Controls the maximum load time of the pre-loader.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
maximum_load_time: 10
});
Type: String
Default: 'all'
Controls on which types of devices to show the loading screen.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
device: 'all'
});
When enable this feature, every time when click on an internal link on your site, the loading screen background will appear again before leaving the current page with animation. Check the demo created by WordPress version.
For example, if your loading screen's ending effect is "Fade Out" (bg_animation is "fade"), then when you click on a link to go to another page on the same site, the loading screen background will show again: with a "Fade In" animation.
Please note: this is an advanced feature, please follow the guide below to use it and get the best result:
And please note: this feature WILL NOT work for the situations listed below:
There are 3 options for this feature: smooth_page_transition, site_root_url and exclude_elements.
Type: Boolean
Default: false
Controls to enable or disable the feature.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
smooth_page_transition: true
});
Type: String
Default: ''
Please provide your site URL to let the script know where to enable the Smooth Page Transition feature. So when a link pointing to an outer site, the feature will not work.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
smooth_page_transition: true,
site_root_url: 'http://www.loftocean.com/loftloader/'
});
Please note: to enable this feature, please:
The option exclude_elements is optional for using Smooth Page Transition feature.
When and how to use it:
<a>
links you would like to disable this feature when click on them.<a>
links a class name, then use this class name to find and exclude these links.Type: String or Boolean
Default: false
Controls which <a>links</a>
will be excluded for Smooth Page Transition feature.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
smooth_page_transition: true,
site_root_url: 'http://www.loftocean.com/loftloader/',
exclude_elements: 'a.exclude-link'
});
This is a new feature since v1.0.6. When enable this feature, the pre-loader will display once only when a visitor first visits your site. When this visitor leaves your site, and comes back later (after a week), the loader will show once again.
You can choose to:
There are 2 options for this feature: once_per_session, and site_root_url.
Type: Boolean or String
Default: false
Controls to enable or disable "Once Per Session", and which type of this feature to enable.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
once_per_session: 'page'
});
Type: String
Default: ''
Please provide your site URL to let the script know where to enable the Once Per Session feature. If the value is empty, the feature will not work.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
once_per_session: 'site',
site_root_url: 'http://www.loftocean.com/loftloader/'
});
Please note:
This is a new feature since v1.0.7.
The loading screen created by LoftLoader only disappears when the preload process is completed. Therefore, if the preload process takes too long (for example, in a slow network environment), visitors have to wait a long time to access the page content. That's why we added this close button: visitors can click the close button to exit the loading screen if they don't want to wait.
There are 2 options for this feature: close_button_timer, and close_button_message.
Type: Number or Boolean
Default: 'false'
Controls whether to enable or disable the "Close Button", and when to display the close button.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
close_button_timer: 10
});
Type: String
Default: ''
Custom text on the close button.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
close_button_timer: 10,
close_button_message: 'Close'
});
Enable this the option then your page will be not able to scroll during the loading process. This feature is for preventing your visitors from accidentally scroll to the middle of the page before the loading process is complete.
Type: String
Default: ''
Controls to enable/disable Page Scrolling while loading.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
disable_page_scrolling: 'on'
});
Please note: if your (or your site visitor’s) browser has a permanent scroll bar (on PC, or set to "always show scroll bars" on Mac), the scroll bar will always be visible even during the loading process.
Therefore, the page content will not move at the end of loading process – this happens if the scroll bar is hidden and then appears after the loading screen disappears, because the page content width will change at this moment.
You can choose the Entrance and Exit Animation for the Inner Elements in the loading screen.
What are Inner Elements?
The Inner Elements are: the loader, the progress indicator, and the message.
But please note: for best results, if you choose to display a progress bar and set its position to “Top” or “Bottom”, then the Entrance & Exit Animation will not be applied to this progress bar. Otherwise it will look weird.
Type: String
Default: ''
Controls the entrance animation for all inner elements.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
inner_elements_entrance_animation: 'inner-enter-fade'
});
Type: String
Default: 'inner-end-fade'
Controls the exit animation for all inner elements.
Possible values:
Code Example:
$('#loftloader-wrapper').loftloader({
inner_elements_exit_animation: 'inner-end-fade'
});
Type: Function
Default: none
Callback function before loftloader process start.
Code Example:
$('#loftloader-wrapper').loftloader({
init: function(){
// Insert JS code here to run before loftloader
}
});
Type: Function
Default: none
Callback function after loftloader process done.
Code Example:
$('#loftloader-wrapper').loftloader({
finish: function(){
// Insert JS code here to run after loftloader
}
});
This is a new feature added in version 1.1.0.
When a page has enabled LoftLoader on it, users can add "?pageloader=false" to the end of the page's URL so that the preloader can be hidden when sharing this page link with others (for example, email this page link to others).
For example: