diff options
author | somratpro <abdulmonnafsomrat@gmail.com> | 2020-11-09 05:59:46 +0300 |
---|---|---|
committer | somratpro <abdulmonnafsomrat@gmail.com> | 2020-11-09 05:59:46 +0300 |
commit | 7526b3bd1f0a12993212e101c34beb2a5118701c (patch) | |
tree | 09e1a4e36b8d37a505c6354bef712f00aaf66872 | |
parent | dcb4d578d6b3ac3c0179b07fba7fe24d43a456ad (diff) |
fixed background image fallback issue
-rw-r--r-- | assets/js/script.js | 17 | ||||
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/partials/banner.html | 2 | ||||
-rw-r--r-- | layouts/partials/cta.html | 2 | ||||
-rw-r--r-- | layouts/partials/feature.html | 2 | ||||
-rw-r--r-- | layouts/partials/testimonial.html | 2 |
6 files changed, 16 insertions, 10 deletions
diff --git a/assets/js/script.js b/assets/js/script.js index e68b426..debfb72 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -6,14 +6,19 @@ $(window).on('load', function () { $('.preloader').fadeOut(100); }); -// Auto close Navbar when click on link -$('.navbar-collapse a').click(function(){ - $(".navbar-collapse").collapse('hide'); -}); - jQuery(function ($) { "use strict"; + + /* ========================================================================= */ + /* Auto close Navbar when click on link + /* ========================================================================= */ + + $('.navbar-collapse a').click(function () { + $(".navbar-collapse").collapse('hide'); + }); + + /* ========================================================================= */ /* lazy load initialize /* ========================================================================= */ @@ -138,4 +143,4 @@ jQuery(function ($) { counter(); }); -}); +});
\ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 66b90c6..fcbac80 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -2,6 +2,7 @@ baseURL = "https://examplesite.com" title = "Meghna" theme = "meghna-hugo" +themesDir = "../.." # post pagination paginate = "6" # post excerpt diff --git a/layouts/partials/banner.html b/layouts/partials/banner.html index 8287382..38d186e 100644 --- a/layouts/partials/banner.html +++ b/layouts/partials/banner.html @@ -5,7 +5,7 @@ {{"<!-- Welcome Slider-->" | safeHTML}} <section class="hero-area" style='background-image: url("{{ .bg_image_webp | absURL }}")'> <!-- this image is for trigger this section fallback background image --> - <img class="lozad d-none" data-src="{{ .bg_image_webp | absURL }}" onerror="this.onerror=null;this.parentElement.style.backgroundImage= 'url({{ .bg_image | absURL }})'"/> + <img class="d-none" src="{{ .bg_image_webp | absURL }}" onerror="this.onerror=null;this.parentElement.style.backgroundImage= 'url({{ .bg_image | absURL }})'"/> <div class="block"> {{ if .icon }} diff --git a/layouts/partials/cta.html b/layouts/partials/cta.html index 9ab82e0..cad2909 100644 --- a/layouts/partials/cta.html +++ b/layouts/partials/cta.html @@ -5,7 +5,7 @@ {{"<!-- Start Call To Action -->" | safeHTML}} <section id="cta" class="call-to-action section-sm bg-1 overly" style='background-image: url("{{ .bg_image_webp | absURL }}")'> <!-- this image is for trigger this section fallback background image --> - <img class="lozad" style="display: none;" onerror="this.onerror=null;this.parentElement.style.backgroundImage= 'url({{ .bg_image | absURL }})'" data-src="{{ .bg_image_webp | absURL }}" /> + <img src="{{ .bg_image_webp | absURL }}" style="display: none;" onerror="this.onerror=null;this.parentElement.style.backgroundImage= 'url({{ .bg_image | absURL }})'"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> diff --git a/layouts/partials/feature.html b/layouts/partials/feature.html index 931d69b..30de2fc 100644 --- a/layouts/partials/feature.html +++ b/layouts/partials/feature.html @@ -8,7 +8,7 @@ <div class="row"> <div class="col-lg-6 padding-0" style="background-image: url('{{ .image_webp | absURL }}'); background-size: cover; background-position: top center; background-repeat: no-repeat; min-height: 400px;"> <!-- this image is for trigger this section fallback background image --> - <img class="lozad" style="display: none;" onerror="this.onerror=null;this.parentElement.style.backgroundImage= 'url({{ .image | absURL }})'" data-src="{{ .image_webp | absURL }}" /> + <img src="{{ .image_webp | absURL }}" style="display: none;" onerror="this.onerror=null;this.parentElement.style.backgroundImage= 'url({{ .image | absURL }})'"> </div> <div class="col-lg-6"> <div class="content-block"> diff --git a/layouts/partials/testimonial.html b/layouts/partials/testimonial.html index 5611d33..39eb7cf 100644 --- a/layouts/partials/testimonial.html +++ b/layouts/partials/testimonial.html @@ -6,7 +6,7 @@ <section id="testimonial" class="testimonial overly section bg-2" style='background-image: url("{{ .bg_image_webp | absURL }}")'> <!-- this image is for trigger this section fallback background image --> - <img class="lozad" style="display: none;" onerror="this.onerror=null;this.parentElement.style.backgroundImage= 'url({{ .bg_image | absURL }})'" data-src="{{ .bg_image_webp | absURL }}" /> + <img src="{{ .bg_image_webp | absURL }}" style="display: none;" onerror="this.onerror=null;this.parentElement.style.backgroundImage= 'url({{ .bg_image | absURL }})'"> <div class="container"> <div class="row"> <div class="col-xl-12"> |