Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/devcows/hugo-universal-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/front.js')
-rw-r--r--static/js/front.js41
1 files changed, 19 insertions, 22 deletions
diff --git a/static/js/front.js b/static/js/front.js
index 5f35807..c9f073a 100644
--- a/static/js/front.js
+++ b/static/js/front.js
@@ -19,12 +19,13 @@ $(function () {
animations()
counters()
demo()
- contactForm()
+ contactFormAjax()
})
// Ajax contact
-function contactForm () {
- var form = $('.contact-form')
+function contactFormAjax () {
+ var form = $('.contact-form-ajax')
+ if (typeof form === 'undefined') return false
form.submit(function () {
$this = $(this)
$.post($(this).attr('action'),
@@ -94,37 +95,31 @@ function sliderHomepage () {
function sliders () {
if ($('.owl-carousel').length) {
$('.customers').owlCarousel({
- items: 6,
+ items: ($('.customers').attr('data-items') || 6),
+ slideSpeed: ($('.customers').attr('data-slide-speed') || 2000),
+ paginationSpeed: ($('.customers').attr('data-pagination-speed') || 1000),
+ autoPlay: $('.customers').attr('data-autoplay') === 'true',
itemsDesktopSmall: [990, 4],
itemsTablet: [768, 2],
itemsMobile: [480, 1]
})
$('.testimonials').owlCarousel({
- items: 4,
+ items: ($('.testimonials').attr('data-items') || 4),
+ slideSpeed: ($('.testimonials').attr('data-slide-speed') || 2000),
+ paginationSpeed: ($('.testimonials').attr('data-pagination-speed') || 1000),
+ autoPlay: $('.testimonials').attr('data-autoplay') === 'true',
itemsDesktopSmall: [990, 3],
itemsTablet: [768, 2],
itemsMobile: [480, 1]
})
- $('.project').owlCarousel({
- navigation: true, // Show next and prev buttons
- navigationText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
- slideSpeed: 300,
- paginationSpeed: 400,
- autoPlay: true,
- stopOnHover: true,
- singleItem: true,
- afterInit: '',
- lazyLoad: true
- })
-
$('.homepage').owlCarousel({
navigation: false, // Show next and prev buttons
- navigationText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
- slideSpeed: 2000,
- paginationSpeed: 1000,
- autoPlay: true,
+ navigationText: ['<i class="fas fa-angle-left"></i>', '<i class="fas fa-angle-right"></i>'],
+ slideSpeed: ($('.homepage').attr('data-slide-speed') || 2000),
+ paginationSpeed: ($('.homepage').attr('data-pagination-speed') || 1000),
+ autoPlay: ($('.homepage').attr('data-autoplay') || 'true') === 'true',
stopOnHover: true,
singleItem: true,
lazyLoad: false,
@@ -221,7 +216,9 @@ function counters () {
function pictureZoom () {
$('.product .image, .post .image, .photostream div').each(function () {
var imgHeight = $(this).find('img').height()
- $(this).height(imgHeight)
+ if (imgHeight) {
+ $(this).height(imgHeight)
+ }
})
}