• Home
  • Documentations
    • Phlox WordPress Theme
    • Phlox Pro WordPress Theme
    • Master Slider jQuery
    • Master Slider WordPress Pro
    • Master Slider WordPress Free
    • LOTUS WordPress Theme
  • Video Tutorials
    • Phlox ? Video Tutorials
    • Master Slider WP Pro
    • Master Slider WP Free
    • Master Slider jQuery
    • Lotus ? Video Tutorials
  • FAQ
    • General Questions
    • LOTUS WordPress Theme
    • Master Slider jQuery
    • Master Slider WordPress
    • CUTE Slider
  • Knowledge base
    • Beginners
    • Advanced Techniques
    • WordPress plugins
  • Support Forum
    • Login Or Register
    • Support Forum
    • Support Policy
Averta Support Center
  • Home
  • Documentations
    • Phlox WordPress Theme
    • Phlox Pro WordPress Theme
    • Master Slider jQuery
    • Master Slider WordPress Pro
    • Master Slider WordPress Free
    • LOTUS WordPress Theme
  • Video Tutorials
    • Phlox ? Video Tutorials
    • Master Slider WP Pro
    • Master Slider WP Free
    • Master Slider jQuery
    • Lotus ? Video Tutorials
  • FAQ
    • General Questions
    • LOTUS WordPress Theme
    • Master Slider jQuery
    • Master Slider WordPress
    • CUTE Slider
  • Knowledge base
    • Beginners
    • Advanced Techniques
    • WordPress plugins
  • Support Forum
    • Login Or Register
    • Support Forum
    • Support Policy

Looking for the answer

  • Home
  • Master Slider JavaScript
  • Layers
  • Adding Image Layer

Adding Image Layer


To insert an image as a layer over the slider, you can use this layer type. To create an image layer, you can define it by an img element or insert the img element inside a container. The following example shows two ways of creating one. Same as other layer types, image layer will be specified by ms-layer class name and data-type="image" attribute.

	<div id="masterslider" class="master-slider">
		<div class="ms-slide">
			<!-- .... -->
			<div class="ms-layer" data-type="image">
				<img src=".../path/to/layer.jpg" alt="">
			</div>
			
			<img class="ms-layer" data-type="image" src=".../path/to/layer.jpg" alt="">
			<!-- .... -->
		</div>
		<!-- .... -->
	</div>

Preloading

If you wish to set image layer to be loaded by the slider loader, you need to set the image path as data attribute. Both src and srcset attributes are supported.

	<div id="masterslider" class="master-slider">
		<div class="ms-slide">
			<!-- .... -->
			<div class="ms-layer" data-type="image">
				<img src=".../path/to/blank.jpg" data-src=".../path/to/layer.jpg" alt="">
			</div>
			
			<img class="ms-layer" data-type="image" src=".../path/to/blank.jpg" data-src=".../path/to/layer.jpg" alt="">

			<!-- srcset -->
			<img class="ms-layer" data-type="image" src="...path/to/blank.gif" data-src="..path/to/original-image.jpg" data-srcset="..path/to/custom-image1.jpg 200w, ..path/to/custom-image2.jpg 900w" alt="">
		
			<!-- .... -->
		</div>
		<!-- .... -->
	</div>

Note: Since adding src attribute is mandatory, it is recommended to set a path to a blank image like the example. You can find a blank.gif example in the download package.

This article only describes how to create the layer. If you need more information about layers, check out the following articles:

  • Positioning layers
  • Animating layers
  • Masking layers
  • Layer parallax effect
  • Linking layer

Was this information helpful?

Submit
Previuos Step
Related articles list
Create New Support Ticket

Maybe You're Searching For These

Introducing Phlox
Phlox Accordion
Enabling Wheel Navigation
Phlox Code
Phlox Quote
Extending and Renewing Phlox Support
Phlox Divider
Adding Thumbnails
Copyright © 2017 Averta. All rights reserved.