Using plugin with background images
-
Hi, I use you plugin on my website with good result.
However, into the home page, the script don’t work because I have different sections (it’s a parallel one page theme) who use backgrounds.I see on the setting that your plugin can work with this type of image with the specific set where you say:
Lazy load background images.
Note: You must add the attribute “data-bg” with a value of path to the image to elements with a background image.
E.g. “<div data-bg=”/path/to/image.png”>…</div>”Well, I tried to implement this without to find a right way.
My section who call the background image appear on code as this:************************************
<section class=”serv_intro intro”
<?php if ($smof_data[‘serv_intro_img’]) { ?>
style=”background-image: url(<?php echo $smof_data[‘serv_intro_img’]; ?>);”
<?php } ?>>
<div class=”black_over”>
<div class=”container text_center”>
<div class=”intro_pad”>
<?php if ($smof_data[‘serv_intro_h1’]) { ?>
<h1><?php printf( __($smof_data[‘serv_intro_h1’])); ?></h1>
<?php } ?>
<?php if ($smof_data[‘serv_intro_h2’]) { ?>
<h2><?php printf( __($smof_data[‘serv_intro_h2’])); ?></h2>
<?php } ?>
</div>
</div>
</div>
</section>
************************************Do you have a suggestion on where I need to add the “data-bg=” tag?
Aright, thank you for any help.
Giadina
- The topic ‘Using plugin with background images’ is closed to new replies.