Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dic-global-dev
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Manzar Hussain
dic-global-dev
Commits
551b764e
Commit
551b764e
authored
Dec 28, 2020
by
Manzar Hussain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new file override.js
parent
5e56899d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
1660 deletions
+121
-1660
envigo.libraries.yml
themes/custom/envigo/envigo.libraries.yml
+1
-0
custom.js
themes/custom/envigo/js/custom.js
+59
-1660
override.js
themes/custom/envigo/js/override.js
+61
-0
No files found.
themes/custom/envigo/envigo.libraries.yml
View file @
551b764e
...
...
@@ -28,6 +28,7 @@ global-style:
js/imagesloaded.pkgd.min.js
:
{}
js/slick.min.js
:
{}
js/custom.js
:
{}
js/override.js
:
{}
js/custom-d.js
:
{}
dependencies
:
-
core/jquery
themes/custom/envigo/js/custom.js
View file @
551b764e
(
function
(
$
)
{
(
function
(
$
)
{
var
includes
=
$
(
"[data-include]"
);
jQuery
.
each
(
includes
,
function
()
{
jQuery
.
each
(
includes
,
function
()
{
var
file
=
/* 'views/' + */
$
(
this
).
data
(
"include"
)
+
".html"
;
$
(
this
).
load
(
file
);
});
...
...
@@ -9,7 +9,7 @@
if
(
$
(
".b_m_header"
).
length
)
{
$
(
".b_m_header"
).
slick
({
autoplay
:
true
,
autoplaySpeed
:
3000
,
autoplaySpeed
:
3000
,
speed
:
1000
,
dots
:
false
,
arrows
:
true
,
...
...
@@ -25,7 +25,7 @@
if
(
$
(
".b_t_header"
).
length
)
{
$
(
".b_t_header"
).
slick
({
autoplay
:
true
,
autoplaySpeed
:
3000
,
autoplaySpeed
:
3000
,
speed
:
1000
,
dots
:
false
,
arrows
:
false
,
...
...
@@ -44,8 +44,7 @@
infinite
:
false
,
slidesToShow
:
4
,
slidesToScroll
:
4
,
responsive
:
[
{
responsive
:
[{
breakpoint
:
1200
,
settings
:
{
arrows
:
true
,
...
...
@@ -70,13 +69,13 @@
//when the slick slide initializes we want to set all of our slides to the same height
$
(
".cs_slider_bp_con"
).
on
(
"setPosition"
,
function
()
{
$
(
".cs_slider_bp_con"
).
on
(
"setPosition"
,
function
()
{
jbResizeSlider
();
});
//we need to maintain a set height when a resize event occurs.
//Some events will through a resize trigger: $(window).trigger('resize');
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
jbResizeSlider
();
});
...
...
@@ -105,8 +104,7 @@
slidesToScroll
:
3
,
nextArrow
:
'<button class="arrowSlider leftArrow"><i class="fa fa-chevron-left" aria-hidden="true"></i><button>'
,
prevArrow
:
'<button class="arrowSlider rightArrow"><i class="fa fa-chevron-right" aria-hidden="true"></i><button>'
,
responsive
:
[
{
responsive
:
[{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
...
...
@@ -123,13 +121,13 @@
//when the slick slide initializes we want to set all of our slides to the same height
$
(
".cs_slider_container"
).
on
(
"setPosition"
,
function
()
{
$
(
".cs_slider_container"
).
on
(
"setPosition"
,
function
()
{
jbResizeSlider
();
});
//we need to maintain a set height when a resize event occurs.
//Some events will through a resize trigger: $(window).trigger('resize');
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
jbResizeSlider
();
});
...
...
@@ -156,8 +154,7 @@
slidesToScroll
:
4
,
nextArrow
:
'<button class="arrowSlider leftArrow"><i class="fa fa-chevron-left" aria-hidden="true"></i><button>'
,
prevArrow
:
'<button class="arrowSlider rightArrow"><i class="fa fa-chevron-right" aria-hidden="true"></i><button>'
,
responsive
:
[
{
responsive
:
[{
breakpoint
:
1200
,
settings
:
{
arrows
:
true
,
...
...
@@ -183,13 +180,13 @@
//when the slick slide initializes we want to set all of our slides to the same height
$
(
".cs_slider_dic_news_inner"
).
on
(
"setPosition"
,
function
()
{
$
(
".cs_slider_dic_news_inner"
).
on
(
"setPosition"
,
function
()
{
jbResizeSlider
();
});
//we need to maintain a set height when a resize event occurs.
//Some events will through a resize trigger: $(window).trigger('resize');
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
jbResizeSlider
();
});
...
...
@@ -215,8 +212,7 @@
infinite
:
false
,
slidesToShow
:
4
,
slidesToScroll
:
4
,
responsive
:
[
{
responsive
:
[{
breakpoint
:
1200
,
settings
:
{
arrows
:
true
,
...
...
@@ -241,13 +237,13 @@
//when the slick slide initializes we want to set all of our slides to the same height
$
(
".cs_slider_con_m_w"
).
on
(
"setPosition"
,
function
()
{
$
(
".cs_slider_con_m_w"
).
on
(
"setPosition"
,
function
()
{
jbResizeSlider
();
});
//we need to maintain a set height when a resize event occurs.
//Some events will through a resize trigger: $(window).trigger('resize');
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
jbResizeSlider
();
});
...
...
@@ -273,8 +269,7 @@
slidesToScroll
:
3
,
nextArrow
:
'<button class="arrowSlider leftArrow"><i class="fa fa-chevron-left" aria-hidden="true"></i><button>'
,
prevArrow
:
'<button class="arrowSlider rightArrow"><i class="fa fa-chevron-right" aria-hidden="true"></i><button>'
,
responsive
:
[
{
responsive
:
[{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
...
...
@@ -291,13 +286,13 @@
//when the slick slide initializes we want to set all of our slides to the same height
$
(
".cs_team_slider_container"
).
on
(
"setPosition"
,
function
()
{
$
(
".cs_team_slider_container"
).
on
(
"setPosition"
,
function
()
{
jbResizeSlider
();
});
//we need to maintain a set height when a resize event occurs.
//Some events will through a resize trigger: $(window).trigger('resize');
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
jbResizeSlider
();
});
...
...
@@ -318,8 +313,8 @@
if
(
$
(
".slider_strip_container"
).
length
)
{
$
(
".slider_strip_container"
).
slick
({
autoplay
:
true
,
autoplaySpeed
:
3000
,
fade
:
false
,
autoplaySpeed
:
3000
,
fade
:
false
,
speed
:
1000
,
dots
:
true
,
arrows
:
false
,
...
...
@@ -341,15 +336,13 @@
slidesToScroll
:
1
,
nextArrow
:
'<button class="arrowSlider leftArrow"><i class="fa fa-chevron-left" aria-hidden="true"></i><button>'
,
prevArrow
:
'<button class="arrowSlider rightArrow"><i class="fa fa-chevron-right" aria-hidden="true"></i><button>'
,
responsive
:
[
{
responsive
:
[{
breakpoint
:
767
,
settings
:
{
arrows
:
false
,
autoplay
:
true
autoplay
:
true
},
}
],
}],
})
}
...
...
@@ -364,8 +357,7 @@
slidesToScroll
:
3
,
nextArrow
:
'<button class="arrowSlider leftArrow"><i class="fa fa-chevron-left" aria-hidden="true"></i><button>'
,
prevArrow
:
'<button class="arrowSlider rightArrow"><i class="fa fa-chevron-right" aria-hidden="true"></i><button>'
,
responsive
:
[
{
responsive
:
[{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
...
...
@@ -384,135 +376,52 @@
$
(
'.box_c_dd_menu'
).
click
(
function
()
{
$
(
'.box_c_dd_menu'
).
click
(
function
()
{
$
(
this
).
toggleClass
(
'active_sb_menu'
);
$
(
this
).
siblings
(
'.sb_dd_m_data'
).
slideToggle
();
})
$
(
'.dd_sub_menu a'
).
click
(
function
(
e
)
{
// e.preventDefault();
$
(
this
).
parents
(
'.dd_sub_menu'
).
toggleClass
(
'activedd_menu'
).
siblings
().
removeClass
(
'activedd_menu'
);
})
var
getLength
=
$
(
".seoContentcon .listin_s_c_d"
).
length
;
if
(
getLength
>
"2"
)
{
$
(
".readMore_con"
).
addClass
(
"activeReadmore"
);
}
else
{
$
(
".readMore_con"
).
removeClass
(
"activeReadmore"
);
}
$
(
".readMore_con a"
).
on
(
"click"
,
function
()
{
var
listClass
=
$
(
this
)
.
parent
()
.
parents
(
".seoContentcon"
)
.
find
(
".listin_s_c_d"
);
listClass
.
toggleClass
(
"activeContent"
);
if
(
listClass
.
hasClass
(
"activeContent"
))
{
var
readless
=
$
(
this
).
data
(
"readless"
);
$
(
this
).
text
(
readless
);
}
else
{
var
readmore
=
$
(
this
).
data
(
"readmore"
);
$
(
this
).
text
(
readmore
);
}
});
if
(
$
(
".coinSlider"
).
length
)
{
$
(
".coinSlider"
).
slick
({
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
3
,
slidesToScroll
:
3
,
responsive
:
[
{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
slidesToShow
:
2
,
slidesToScroll
:
2
,
},
},
{
breakpoint
:
767
,
settings
:
"unslick"
,
/* settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
} */
},
],
});
}
if
(
$
(
".blogSlider"
).
length
)
{
$
(
".blogSlider"
).
slick
({
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
3
,
slidesToScroll
:
3
,
responsive
:
[
{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
slidesToShow
:
2
,
slidesToScroll
:
2
,
},
},
{
breakpoint
:
767
,
settings
:
"unslick"
,
/* settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
} */
},
],
});
}
if
(
$
(
".categorySlider"
).
length
)
{
$
(
".categorySlider"
).
slick
({
if
(
$
(
".b_slider_m_c_box"
).
length
)
{
$
(
".b_slider_m_c_box"
).
slick
({
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
4
,
slidesToScroll
:
4
,
/* mobileFirst: true, */
responsive
:
[
{
nextArrow
:
'<button class="arrowSlider leftArrow"><i class="fa fa-chevron-left" aria-hidden="true"></i><button>'
,
prevArrow
:
'<button class="arrowSlider rightArrow"><i class="fa fa-chevron-right" aria-hidden="true"></i><button>'
,
responsive
:
[
{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
...
...
@@ -521,1547 +430,37 @@
},
},
{
breakpoint
:
576
,
settings
:
{
arrows
:
true
,
slidesToShow
:
1
,
slidesToScroll
:
1
,
},
},
],
});
}
if
(
$
(
".locationSlider"
).
length
)
{
$
(
".locationSlider"
).
slick
({
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
3
,
slidesToScroll
:
3
,
responsive
:
[
{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
slidesToShow
:
2
,
slidesToScroll
:
2
,
},
},
/* {
breakpoint: 576,
settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
}
} */
{
breakpoint
:
767
,
settings
:
"unslick"
,
/* settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
} */
settings
:
"unslick"
},
],
});
}
if
(
$
(
".goldSavingSlider"
).
length
)
{
$
(
".goldSavingSlider"
).
slick
({
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
3
,
slidesToScroll
:
3
,
responsive
:
[
{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
slidesToShow
:
2
,
slidesToScroll
:
2
,
},
},
/* {
breakpoint: 576,
settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
}
} */
{
breakpoint
:
767
,
settings
:
"unslick"
,
/* settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
} */
},
],
});
}
if
(
$
(
".p_s_c_b_m"
).
length
)
{
$
(
".p_s_c_b_m"
).
slick
({
dots
:
false
,
arrows
:
false
,
autoplay
:
true
,
autoplaySpeed
:
1000
,
infinite
:
true
,
slidesToShow
:
6
,
slidesToScroll
:
1
,
rows
:
0
,
responsive
:
[
{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
slidesToShow
:
3
,
},
},
{
breakpoint
:
576
,
settings
:
{
arrows
:
true
,
slidesToShow
:
2
,
},
},
],
});
//when the slick slide initializes we want to set all of our slides to the same height
$
(
".p_s_c_b_m"
).
on
(
"setPosition"
,
function
()
{
$
(
".b_slider_m_c_box"
).
on
(
"setPosition"
,
function
()
{
jbResizeSlider
();
});
//we need to maintain a set height when a resize event occurs.
//Some events will through a resize trigger: $(window).trigger('resize');
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
jbResizeSlider
();
});
//since multiple events can trigger a slider adjustment, we will control that adjustment here
function
jbResizeSlider
()
{
$slickSlider
=
$
(
".p_s_c_b_m
"
);
$slickSlider
=
$
(
".b_slider_m_c_box
"
);
$slickSlider
.
find
(
".slick-slide"
).
height
(
"auto"
);
var
slickTrack
=
$slickSlider
.
find
(
".slick-track"
);
var
slickTrackHeight
=
$
(
slickTrack
).
height
();
$slickSlider
.
find
(
".slick-slide"
).
css
(
"height"
,
slickTrackHeight
+
"px"
);
}
}
/*
$('.user_Profile_container').on('click','.userProfile', function(){
$(this).parent().addClass('active');
})
$(document).click(function (e) {
if (!$(e.target).is('.user_Profile_container, .user_Profile_container *')) {
$('.user_Profile_container').removeClass('active');
}
}); */
//tab inside slider code
var
options
=
{
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
3
,
slidesToScroll
:
3
,
responsive
:
[
{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
slidesToShow
:
2
,
slidesToScroll
:
2
,
},
},
/* {
breakpoint: 576,
settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
}
} */
{
breakpoint
:
767
,
settings
:
"unslick"
,
/* settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
} */
},
],
};
$
(
".t_i_c_i_b li a"
).
on
(
"click"
,
function
()
{
var
a
=
$
(
this
).
parent
();
a
.
addClass
(
"active"
).
siblings
().
removeClass
(
"active"
);
var
c
=
a
.
index
();
var
b
=
$
(
this
)
.
parents
(
".tab_pointer_elemt"
)
.
siblings
(
".tab_con_outer"
)
.
find
(
".tab_con_b_inner"
);
b
.
removeClass
(
"active"
).
find
(
".slider_c_o"
).
removeClass
(
"active"
);
b
.
eq
(
c
).
addClass
(
"active"
).
find
(
".slider_c_o"
).
addClass
(
"active"
);
var
m
=
b
.
eq
(
c
).
find
(
".tabSlider"
);
var
n
=
b
.
find
(
".tabSlider"
);
m
.
slick
(
"unslick"
);
m
.
slick
(
options
);
});
$
(
".tab_mob_elmt_slider"
).
on
(
"click"
,
function
()
{
var
b
=
$
(
this
).
parents
(
".tab_con_b_inner"
);
b
.
toggleClass
(
"active"
).
siblings
().
removeClass
(
"active"
);
var
d
=
b
.
find
(
".slider_c_o"
).
toggleClass
(
"active"
);
b
.
siblings
().
find
(
".slider_c_o"
).
removeClass
(
"active"
);
var
m
=
d
.
find
(
".tabSlider"
);
m
.
slick
(
"unslick"
);
m
.
slick
(
options
);
});
$
(
".tabSlider"
).
slick
(
options
);
//$('.t_i_c_i_b li:first-child a').trigger('click');
$
(
".a_b_o_container"
).
not
(
".active"
).
find
(
".c_part_o_d"
).
slideUp
();
$
(
".a_b_o_container.active"
).
find
(
".c_part_o_d"
).
slideDown
();
$
(
".h2_a_c"
).
on
(
"click"
,
function
()
{
var
a
=
$
(
this
).
parents
(
".a_b_o_container"
).
find
(
".c_part_o_d"
);
$
(
this
).
parents
(
".a_b_o_container"
).
siblings
().
removeClass
(
"active"
);
$
(
this
)
.
parents
(
".a_b_o_container"
)
.
siblings
()
.
find
(
".c_part_o_d"
)
.
slideUp
();
if
(
a
.
is
(
":visible"
))
{
$
(
this
).
parents
(
".a_b_o_container"
).
removeClass
(
"active"
);
$
(
this
).
parents
(
".a_b_o_container"
).
find
(
".c_part_o_d"
).
slideUp
();
}
else
{
$
(
this
).
parents
(
".a_b_o_container"
).
addClass
(
"active"
);
$
(
this
).
parents
(
".a_b_o_container"
).
find
(
".c_part_o_d"
).
slideDown
();
console
.
log
(
"else"
);
}
});
$
(
".listing_filter li"
).
on
(
"click"
,
function
()
{
$
(
this
).
addClass
(
"active"
).
siblings
().
removeClass
(
"active"
);
if
(
$
(
this
).
hasClass
(
"listing_dta active"
))
{
$
(
this
).
parents
(
".listing_grid_con"
).
addClass
(
"activeListing"
);
}
else
{
$
(
this
).
parents
(
".listing_grid_con"
).
removeClass
(
"activeListing"
);
}
});
$
(
".filter_con_box"
).
on
(
"click"
,
function
()
{
$
(
this
).
parents
(
"body"
).
addClass
(
"scrollNone"
);
$
(
this
)
.
parents
(
".listing_grid_con"
)
.
find
(
".cat_listing_outer"
)
.
addClass
(
"activeCat"
);
});
$
(
".closeCatCon"
).
on
(
"click"
,
function
()
{
$
(
this
).
parents
(
"body"
).
removeClass
(
"scrollNone"
);
$
(
this
).
parents
(
".cat_listing_outer"
).
removeClass
(
"activeCat"
);
});
$
(
".btnClear"
).
on
(
"click"
,
function
()
{
$
(
this
)
.
parents
(
".cat_listing_wrapper"
)
.
find
(
".listing_c_p li"
)
.
removeClass
(
"activeCheckbox"
);
});
$
(
".tab_i_c_b li a"
).
on
(
"click"
,
function
()
{
var
a
=
$
(
this
).
parent
();
a
.
addClass
(
"active"
).
siblings
().
removeClass
(
"active"
);
var
c
=
a
.
index
();
var
b
=
$
(
this
)
.
parents
(
".tab_dt_elemt"
)
.
siblings
(
".tab_content_con_main"
)
.
find
(
".tab_inner_c_b_m"
);
b
.
removeClass
(
"tabContent_dt"
);
b
.
eq
(
c
).
addClass
(
"tabContent_dt"
);
});
$
(
".tab_mob_elmt"
).
on
(
"click"
,
function
()
{
$
(
this
).
parents
(
".tab_inner_c_b_m"
).
toggleClass
(
"active"
);
$
(
this
).
parents
(
".tab_inner_c_b_m"
).
siblings
().
removeClass
(
"active"
);
var
hHeight
=
$
(
".mainHeadercontainer"
).
outerHeight
();
var
a
=
$
(
this
).
offset
().
top
-
hHeight
;
$
(
"html, body"
).
animate
({
scrollTop
:
a
},
700
);
});
/*Increase or decrease no. in HTML*/
$
(
document
).
on
(
"click"
,
".decrease"
,
function
()
{
var
input
=
$
(
this
).
next
(
".quantityContainer"
).
find
(
"input[type=number]"
);
var
value
=
parseInt
(
input
.
val
());
value
=
isNaN
(
value
)
?
1
:
value
;
value
<=
1
?
(
value
=
2
)
:
""
;
value
--
;
input
.
val
(
value
);
input
.
trigger
(
"change"
);
});
$
(
document
).
on
(
"click"
,
".increase"
,
function
()
{
var
input
=
$
(
this
).
prev
(
".quantityContainer"
).
find
(
"input[type=number]"
);
var
value
=
parseInt
(
input
.
val
());
value
=
isNaN
(
value
)
?
1
:
value
;
value
<
1
?
(
value
=
0
)
:
""
;
value
++
;
input
.
val
(
value
);
input
.
trigger
(
"change"
);
});
if
(
$
(
"#usermailvalidation"
).
length
)
{
jQuery
.
validator
.
addMethod
(
"customEmail"
,
function
(
value
,
element
)
{
return
(
this
.
optional
(
element
)
||
/^
[
a-zA-Z0-9._-
]
+@
[
a-zA-Z0-9.-
]
+
\.[
a-zA-Z
]{2,4}
$/i
.
test
(
value
)
);
},
"Please enter valid email address!"
);
$
(
"#usermailvalidation"
).
validate
({
rules
:
{
usr_email
:
{
required
:
true
,
email
:
true
,
customEmail
:
true
,
},
usr_password
:
{
required
:
true
,
},
},
messages
:
{
usr_email
:
{
required
:
"Please enter email address"
,
email
:
"Please enter a valid email address"
,
},
usr_password
:
{
required
:
"Please enter a password"
,
},
},
});
}
if
(
$
(
"#guestmailvalidation"
).
length
)
{
jQuery
.
validator
.
addMethod
(
"customEmail"
,
function
(
value
,
element
)
{
return
(
this
.
optional
(
element
)
||
/^
[
a-zA-Z0-9._-
]
+@
[
a-zA-Z0-9.-
]
+
\.[
a-zA-Z
]{2,4}
$/i
.
test
(
value
)
);
},
"Please enter valid email address!"
);
$
(
"#guestmailvalidation"
).
validate
({
rules
:
{
guest_usr_email
:
{
required
:
true
,
email
:
true
,
customEmail
:
true
,
},
},
messages
:
{
guest_usr_email
:
{
required
:
"Please enter email address"
,
email
:
"Please enter a valid email address"
,
},
},
});
}
if
(
$
(
"#address_form"
).
length
)
{
jQuery
.
validator
.
addMethod
(
"custom_mail"
,
function
(
value
,
element
)
{
return
(
this
.
optional
(
element
)
||
/^
[
a-zA-Z0-9._-
]
+@
[
a-zA-Z0-9.-
]
+
\.[
a-zA-Z
]{2,4}
$/i
.
test
(
value
)
);
},
"Please enter valid email address!"
);
jQuery
.
validator
.
addMethod
(
"lettersonly"
,
function
(
value
,
element
)
{
return
this
.
optional
(
element
)
||
/^
[
a-z
]
+$/i
.
test
(
value
);
},
"Letters only please"
);
$
(
"#address_form"
).
validate
({
rules
:
{
usr_f_name
:
{
required
:
true
,
lettersonly
:
true
,
},
usr_l_name
:
{
required
:
true
,
lettersonly
:
true
,
},
usr_country
:
{
required
:
true
,
},
usr_state
:
{
required
:
true
,
lettersonly
:
true
,
},
usr_city
:
{
required
:
true
,
lettersonly
:
true
,
},
usr_s_address
:
{
required
:
true
,
},
usr_zip
:
{
required
:
true
,
},
usr_tel
:
{
required
:
true
,
},
usr_email
:
{
required
:
true
,
email
:
true
,
custom_mail
:
true
,
},
sf_usr_f_name
:
{
required
:
true
,
lettersonly
:
true
,
},
sf_usr_l_name
:
{
required
:
true
,
lettersonly
:
true
,
},
sf_usr_country
:
{
required
:
true
,
},
sf_usr_state
:
{
required
:
true
,
lettersonly
:
true
,
},
sf_usr_city
:
{
required
:
true
,
lettersonly
:
true
,
},
sf_usr_s_address
:
{
required
:
true
,
},
sf_usr_zip
:
{
required
:
true
,
},
sf_usr_tel
:
{
required
:
true
,
},
sf_usr_email
:
{
required
:
true
,
email
:
true
,
custom_mail
:
true
,
},
},
messages
:
{
usr_f_name
:
{
required
:
"Please enter your first name"
,
},
usr_l_name
:
{
required
:
"Please enter your last name"
,
},
usr_country
:
{
required
:
"Please select your country"
,
},
usr_state
:
{
required
:
"Please enter your state"
,
},
usr_city
:
{
required
:
"Please enter your city"
,
},
usr_s_address
:
{
required
:
"Please enter your address"
,
},
usr_zip
:
{
required
:
"Please enter your zip code"
,
},
usr_tel
:
{
required
:
"Please enter your mobile number"
,
},
usr_email
:
{
required
:
"Please enter email address"
,
email
:
"Please enter a valid email address"
,
},
sf_usr_f_name
:
{
required
:
"Please enter your first name"
,
},
sf_usr_l_name
:
{
required
:
"Please enter your last name"
,
},
sf_usr_country
:
{
required
:
"Please select your country"
,
},
sf_usr_state
:
{
required
:
"Please enter your state"
,
},
sf_usr_city
:
{
required
:
"Please enter your city"
,
},
sf_usr_s_address
:
{
required
:
"Please enter your address"
,
},
sf_usr_zip
:
{
required
:
"Please enter your zip code"
,
},
sf_usr_tel
:
{
required
:
"Please enter your mobile number"
,
},
sf_usr_email
:
{
required
:
"Please enter email address"
,
email
:
"Please enter a valid email address"
,
},
},
});
}
/*
if ($("#shipping_form").length) {
jQuery.validator.addMethod(
"custom_mail",
function (value, element) {
return (
this.optional(element) ||
/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i.test(value)
);
},
"Please enter valid email address!"
);
jQuery.validator.addMethod(
"lettersonly",
function (value, element) {
return this.optional(element) || /^[a-z]+$/i.test(value);
},
"Letters only please"
);
$("#shipping_form").validate({
rules: {},
messages: {
usr_f_name: {
required: "Please enter your first name",
},
usr_l_name: {
required: "Please enter your last name",
},
usr_country: {
required: "Please select your country",
},
usr_state: {
required: "Please enter your state",
},
usr_city: {
required: "Please enter your city",
},
usr_s_address: {
required: "Please enter your address",
},
usr_zip: {
required: "Please enter your zip code",
},
usr_tel: {
required: "Please enter your mobile number",
},
usr_email: {
required: "Please enter email address",
email: "Please enter a valid email address",
},
},
});
} */
/* $(".checkout-button").on("click", function (e) {
e.preventDefault();
$("body")
.find(".form-steps .form-steps__item--active")
.not(".form-steps__item--completed")
.addClass("form-steps__item--completed")
.next()
.addClass("form-steps__item--active");
$(this).parents(".cartContainerouter").addClass("loadContainerbox");
}); */
$
(
".checkMailaddress"
).
on
(
"click"
,
function
()
{
if
(
$
(
"#usermailvalidation"
).
valid
())
{
$
(
this
).
parents
(
".process_form"
).
addClass
(
"showOther"
);
}
});
$
(
".proceedBtn"
).
on
(
"click"
,
function
()
{
if
(
$
(
"#usermailvalidation"
).
valid
())
{
$
(
"body"
)
.
find
(
".form-steps .form-steps__item--active"
)
.
not
(
".form-steps__item--completed"
)
.
addClass
(
"form-steps__item--completed"
)
.
next
()
.
addClass
(
"form-steps__item--active"
);
var
a
=
$
(
this
)
.
parents
(
".cartContainerouter"
)
.
removeClass
(
"loadContainerbox"
);
a
.
find
(
".step_p1"
).
addClass
(
"hideStep"
);
a
.
find
(
".step_p2"
).
removeClass
(
"hideStep"
);
}
});
$
(
".guestproceedBtn"
).
on
(
"click"
,
function
()
{
if
(
$
(
"#guestmailvalidation"
).
valid
())
{
$
(
"body"
)
.
find
(
".form-steps .form-steps__item--active"
)
.
not
(
".form-steps__item--completed"
)
.
addClass
(
"form-steps__item--completed"
)
.
next
()
.
addClass
(
"form-steps__item--active"
);
var
a
=
$
(
this
)
.
parents
(
".cartContainerouter"
)
.
removeClass
(
"loadContainerbox"
);
a
.
find
(
".step_p1"
).
addClass
(
"hideStep"
);
a
.
find
(
".step_p2"
).
removeClass
(
"hideStep"
);
}
});
$
(
".proceed_clk_evnt"
).
on
(
"click"
,
function
()
{
alert
(
"Order Submitted"
);
/* $('body').find('.form-steps .form-steps__item--active').not('.form-steps__item--completed').addClass('form-steps__item--completed').next().addClass('form-steps__item--active');
var a = $(this).parents('.cartContainerouter').removeClass('loadContainerbox');
a.find('.step_p2').addClass('hideStep');
a.find('.smryContainerbox').addClass('hideStep');
a.find('.step_p3').removeClass('hideStep'); */
});
$
(
".remember_me p"
).
on
(
"click"
,
function
()
{
var
getCheckbox
=
$
(
this
)
.
parents
(
".remember_me"
)
.
find
(
' input[type="checkbox"]'
);
if
(
getCheckbox
.
is
(
":checked"
))
{
getCheckbox
.
prop
(
"checked"
,
false
);
$
(
this
).
parents
(
".remember_me"
).
removeClass
(
"activeCheckbox"
);
/* $('#guestmailvalidation').hide();
$('#usermailvalidation').show(); */
}
else
{
getCheckbox
.
prop
(
"checked"
,
true
);
$
(
this
).
parents
(
".remember_me"
).
addClass
(
"activeCheckbox"
);
/* $('#usermailvalidation').hide();
$('#guestmailvalidation').show(); */
}
});
$
(
".b3_btn"
).
on
(
"click"
,
function
()
{
$
(
"body"
)
.
find
(
".form-steps .form-steps__item--active"
)
.
not
(
".form-steps__item--completed"
)
.
removeClass
(
"form-steps__item--active"
)
.
prev
()
.
removeClass
(
"form-steps__item--completed"
);
var
a
=
$
(
".proceed_clk_evnt"
)
.
parents
(
".cartContainerouter"
)
.
removeClass
(
"loadContainerbox"
);
a
.
find
(
".step_p3, .step_p1"
).
addClass
(
"hideStep"
);
a
.
find
(
".smryContainerbox"
).
removeClass
(
"hideStep"
);
a
.
find
(
".step_p2"
).
removeClass
(
"hideStep"
);
});
$
(
".b2_btn"
).
on
(
"click"
,
function
()
{
$
(
"body"
)
.
find
(
".form-steps .form-steps__item--active"
)
.
not
(
".form-steps__item--completed"
)
.
removeClass
(
"form-steps__item--active"
)
.
prev
()
.
removeClass
(
"form-steps__item--completed"
);
var
a
=
$
(
".proceedBtn"
)
.
parents
(
".cartContainerouter"
)
.
addClass
(
"loadContainerbox"
);
a
.
find
(
".step_p2"
).
addClass
(
"hideStep"
);
});
$
(
".b1_btn"
).
on
(
"click"
,
function
()
{
$
(
"body"
)
.
find
(
".form-steps .form-steps__item--active"
)
.
not
(
".form-steps__item--completed"
)
.
removeClass
(
"form-steps__item--active"
)
.
prev
()
.
removeClass
(
"form-steps__item--completed"
);
var
a
=
$
(
".proceedBtn"
)
.
parents
(
".cartContainerouter"
)
.
removeClass
(
"loadContainerbox"
);
a
.
find
(
".step_p1"
).
removeClass
(
"hideStep"
);
});
$
(
".b3_btn, .b2_btn, .b1_btn, .checkout-button, .proceedBtn, .guestproceedBtn, .proceed_clk_evnt, .confirm_btn_main"
).
on
(
"click"
,
function
()
{
var
hHeight
=
$
(
".mainHeadercontainer"
).
outerHeight
();
var
a
=
$
(
".checkoutMaincon"
).
offset
().
top
-
hHeight
;
$
(
"html, body"
).
animate
({
scrollTop
:
a
},
700
);
console
.
log
(
"animate data"
);
});
$
(
".shipping_address_c p"
).
on
(
"click"
,
function
()
{
var
getCheckbox
=
$
(
this
)
.
parents
(
".shipping_address_c"
)
.
find
(
' input[type="checkbox"]'
);
if
(
getCheckbox
.
is
(
":checked"
))
{
getCheckbox
.
prop
(
"checked"
,
false
);
$
(
this
).
parents
(
".shipping_address_c"
).
removeClass
(
"activeCheckbox"
);
$
(
this
).
parents
(
".shipping_wrapper"
).
removeClass
(
"activeShipping"
);
$
(
".shipping_c_b_m_i"
).
siblings
(
"li"
).
find
(
"span"
).
trigger
(
"click"
);
}
else
{
getCheckbox
.
prop
(
"checked"
,
true
);
$
(
this
).
parents
(
".shipping_address_c"
).
addClass
(
"activeCheckbox"
);
$
(
this
).
parents
(
".shipping_wrapper"
).
addClass
(
"activeShipping"
);
$
(
".shipping_c_b_m_i span"
).
trigger
(
"click"
);
}
});
$
(
".list_radio li span"
).
click
(
function
()
{
$
(
this
).
parent
().
addClass
(
"active"
).
siblings
().
removeClass
(
"active"
);
$
(
this
).
find
(
"input[type=radio]"
).
prop
(
"checked"
,
true
);
$
(
this
)
.
parent
()
.
siblings
()
.
find
(
"input[type=radio]"
)
.
prop
(
"checked"
,
false
);
});
$
(
".dd_inner span"
).
click
(
function
()
{
$
(
this
).
parents
(
".dd_inner"
).
toggleClass
(
"active"
);
});
$
(
".dd_inner li"
).
click
(
function
()
{
var
a
=
$
(
this
).
text
();
$
(
this
).
parents
(
".dd_inner"
).
find
(
"span"
).
empty
().
text
(
a
);
$
(
this
).
addClass
(
"activeCntry"
).
siblings
().
removeClass
(
"activeCntry"
);
$
(
this
).
parents
(
".dd_inner"
).
removeClass
(
"active"
);
});
$
(
document
).
click
(
function
(
e
)
{
if
(
!
$
(
e
.
target
).
is
(
".dd_inner, .dd_inner *"
))
{
$
(
".dd_inner"
).
removeClass
(
"active"
);
}
});
/* $(".delivery_btn .btn_e").on("click", function (e) {
e.preventDefault();
var m = $(this).parents(".address_con_loop").addClass("active");
m.find(".selectAddress input[type=radio]").prop("checked", true);
m.siblings()
.find(".selectAddress input[type=radio]")
.prop("checked", false);
m.siblings().removeClass("active");
}); */
/* $(".cancel_form_data, .cloaseOverlay").click(function () {
$(this).parents("body").removeClass("scrollNone");
$(this).parents(".overlay_outer").removeClass("activePop");
}); */
$
(
".editAddress"
).
click
(
function
()
{
$
(
this
)
.
parents
(
".addedAddress"
)
.
find
(
".add_con_m_b"
)
.
addClass
(
"d_edit_data"
);
$
(
this
)
.
parents
(
".addedAddress"
)
.
find
(
".form_con_b_m"
)
.
addClass
(
"form_c_b_m_d"
)
.
slideDown
();
});
$
(
".save_form_data"
).
on
(
"click"
,
function
()
{
if
(
$
(
"#address_form"
).
valid
())
{
$
(
".addedAddress"
).
find
(
".add_con_m_b"
).
removeClass
(
"d_edit_data"
);
$
(
".addedAddress"
)
.
find
(
".form_con_b_m"
)
.
removeClass
(
"form_c_b_m_d"
)
.
slideUp
();
location
.
href
=
"thank-you.html"
;
}
});
/* $(".save_shipping_form_data").on("click", function () {
if ($("#shipping_form").valid()) {
alert("Update Shipping Address");
}
}); */
$
(
".address_radio li span"
).
click
(
function
()
{
$
(
this
).
parent
().
addClass
(
"active"
).
siblings
().
removeClass
(
"active"
);
$
(
this
).
find
(
"input[type=radio]"
).
prop
(
"checked"
,
true
);
$
(
this
)
.
parent
()
.
siblings
()
.
find
(
"input[type=radio]"
)
.
prop
(
"checked"
,
false
);
var
indexLi
=
$
(
this
).
parent
().
index
();
$
(
this
)
.
parents
(
".address_main_con"
)
.
find
(
".addressMainelement"
)
.
eq
(
indexLi
)
.
addClass
(
"activeContainer"
)
.
siblings
()
.
removeClass
(
"activeContainer"
);
});
$
(
".confirm_btn_main"
).
click
(
function
()
{
$
(
"body"
)
.
find
(
".form-steps .form-steps__item--active"
)
.
not
(
".form-steps__item--completed"
)
.
addClass
(
"form-steps__item--completed"
)
.
next
()
.
addClass
(
"form-steps__item--active"
);
alert
(
"Order placed"
);
});
$
(
".tt_mcb i"
).
on
(
"click"
,
function
()
{
$
(
this
).
parents
(
".dta_tble_con"
).
find
(
".tt_mcb"
).
removeClass
(
"actvieTT"
);
$
(
this
).
parents
(
".tt_mcb"
).
addClass
(
"actvieTT"
);
});
$
(
".close_tt"
).
on
(
"click"
,
function
()
{
$
(
this
).
parents
(
".tt_mcb"
).
removeClass
(
"actvieTT"
);
});
$
(
document
).
click
(
function
(
e
)
{
if
(
!
$
(
e
.
target
).
is
(
".tt_mcb, .tt_mcb *"
))
{
$
(
".tt_mcb"
).
removeClass
(
"actvieTT"
);
}
});
$
(
".send_enquiry_form"
).
on
(
"click"
,
function
()
{
if
(
$
(
window
).
width
()
<=
991
)
{
$
(
".tab_content_con_main .tab_inner_c_b_m"
)
.
eq
(
"3"
)
.
find
(
".tab_mob_elmt"
)
.
trigger
(
"click"
);
var
v
=
$
(
".tab_content_con_main .tab_inner_c_b_m"
).
eq
(
"3"
).
offset
().
top
;
var
hHeight
=
$
(
".mainHeadercontainer"
).
outerHeight
();
}
else
{
$
(
".tab_i_c_b li"
).
eq
(
"3"
).
find
(
"a"
).
trigger
(
"click"
);
var
v
=
$
(
".tabContainer_main"
).
offset
().
top
;
var
hHeight
=
$
(
".mainHeadercontainer"
).
outerHeight
();
}
var
a
=
v
-
hHeight
;
$
(
"html, body"
).
animate
({
scrollTop
:
a
},
700
);
});
$
(
".con_tab_container_box li"
).
on
(
"click"
,
function
()
{
var
a
=
$
(
this
);
a
.
addClass
(
"activeConloc"
).
siblings
().
removeClass
(
"activeConloc"
);
var
c
=
a
.
index
();
var
b
=
$
(
this
)
.
parents
(
".con_tab_container_box"
)
.
siblings
(
".con_content_detail"
)
.
find
(
".con_i_txt_con"
);
b
.
removeClass
(
"active_d_con_box"
);
b
.
eq
(
c
).
addClass
(
"active_d_con_box"
);
});
$
(
".con_cmob_c"
).
on
(
"click"
,
function
()
{
$
(
this
).
parents
(
".con_i_txt_con"
).
toggleClass
(
"activecontry_address"
);
$
(
this
)
.
parents
(
".con_i_txt_con"
)
.
siblings
()
.
removeClass
(
"activecontry_address"
);
var
hHeight
=
$
(
".mainHeadercontainer"
).
outerHeight
();
var
a
=
$
(
this
).
offset
().
top
-
hHeight
;
$
(
"html, body"
).
animate
({
scrollTop
:
a
},
700
);
});
$
(
".my_a_r_c_box p"
).
on
(
"click"
,
function
()
{
var
getCheckbox
=
$
(
this
)
.
parents
(
".my_a_r_c_box"
)
.
find
(
' input[type="checkbox"]'
);
if
(
getCheckbox
.
is
(
":checked"
))
{
getCheckbox
.
prop
(
"checked"
,
false
);
$
(
this
).
parents
(
".my_a_r_c_box"
).
removeClass
(
"activeCheckbox"
);
}
else
{
getCheckbox
.
prop
(
"checked"
,
true
);
$
(
this
).
parents
(
".my_a_r_c_box"
).
addClass
(
"activeCheckbox"
);
}
});
$
(
".my_a_tab_c li a"
).
on
(
"click"
,
function
(
e
)
{
e
.
preventDefault
();
var
a
=
$
(
this
).
parent
();
a
.
addClass
(
"active_my_a_t"
).
siblings
().
removeClass
(
"active_my_a_t"
);
var
c
=
a
.
index
();
var
b
=
$
(
this
)
.
parents
(
".my_a_tab_c"
)
.
siblings
(
".my_a_f_c"
)
.
find
(
".my_a_f_c_i_b"
);
b
.
removeClass
(
"activetab_c"
);
b
.
eq
(
c
).
addClass
(
"activetab_c"
);
});
if
(
$
(
"#userlogin"
).
length
)
{
$
(
"#userlogin"
).
validate
({
rules
:
{
username
:
{
required
:
true
,
},
password
:
{
required
:
true
,
},
},
messages
:
{
username
:
{
required
:
"Please your user or email address"
,
},
password
:
{
required
:
"Please enter a password"
,
},
},
});
}
if
(
$
(
"#userregisterin"
).
length
)
{
jQuery
.
validator
.
addMethod
(
"customEmail"
,
function
(
value
,
element
)
{
return
(
this
.
optional
(
element
)
||
/^
[
a-zA-Z0-9._-
]
+@
[
a-zA-Z0-9.-
]
+
\.[
a-zA-Z
]{2,4}
$/i
.
test
(
value
)
);
},
"Please enter valid email address!"
);
$
(
"#userregisterin"
).
validate
({
rules
:
{
username
:
{
required
:
true
,
},
email
:
{
required
:
true
,
email
:
true
,
customEmail
:
true
,
},
password
:
{
required
:
true
,
},
},
messages
:
{
username
:
{
required
:
"Please your user name"
,
},
email
:
{
required
:
"Please enter email address"
,
email
:
"Please enter a valid email address"
,
},
password
:
{
required
:
"Please enter a password"
,
},
},
});
}
if
(
$
(
"#billingform"
).
length
)
{
jQuery
.
validator
.
addMethod
(
"customEmail"
,
function
(
value
,
element
)
{
return
(
this
.
optional
(
element
)
||
/^
[
a-zA-Z0-9._-
]
+@
[
a-zA-Z0-9.-
]
+
\.[
a-zA-Z
]{2,4}
$/i
.
test
(
value
)
);
},
"Please enter valid email address!"
);
$
(
"#billingform"
).
validate
({
rules
:
{
firstname
:
{
required
:
true
,
},
lastname
:
{
required
:
true
,
},
country
:
{
required
:
true
,
},
streetaddress
:
{
required
:
true
,
},
towncity
:
{
required
:
true
,
},
countyother
:
{
required
:
true
,
},
zip
:
{
required
:
true
,
},
phonenumber
:
{
required
:
true
,
},
emailaddress
:
{
required
:
true
,
email
:
true
,
customEmail
:
true
,
},
},
messages
:
{
firstname
:
{
required
:
"Please enter your first name"
,
},
lastname
:
{
required
:
"Please enter your last name"
,
},
country
:
{
required
:
"Please select your country"
,
},
streetaddress
:
{
required
:
"Please enter your address"
,
},
towncity
:
{
required
:
"Please enter your town/city"
,
},
countyother
:
{
required
:
"Please enter your state"
,
},
zip
:
{
required
:
"Please enter your zip"
,
},
phonenumber
:
{
required
:
"Please enter your mobile number"
,
},
emailaddress
:
{
required
:
"Please enter email address"
,
email
:
"Please enter a valid email address"
,
},
},
});
}
if
(
$
(
"#accountupdate"
).
length
)
{
jQuery
.
validator
.
addMethod
(
"customEmail"
,
function
(
value
,
element
)
{
return
(
this
.
optional
(
element
)
||
/^
[
a-zA-Z0-9._-
]
+@
[
a-zA-Z0-9.-
]
+
\.[
a-zA-Z
]{2,4}
$/i
.
test
(
value
)
);
},
"Please enter valid email address!"
);
$
(
"#accountupdate"
).
validate
({
rules
:
{
firstname
:
{
required
:
true
,
},
lastname
:
{
required
:
true
,
},
displayname
:
{
required
:
true
,
},
emailaddress
:
{
required
:
true
,
email
:
true
,
customEmail
:
true
,
},
},
messages
:
{
firstname
:
{
required
:
"Please enter your first name"
,
},
lastname
:
{
required
:
"Please enter your last name"
,
},
displayname
:
{
required
:
"Please select user name"
,
},
emailaddress
:
{
required
:
"Please enter email address"
,
email
:
"Please enter a valid email address"
,
},
},
});
}
if
(
$
(
"#resetpasswordform"
).
length
)
{
$
(
"#resetpasswordform"
).
validate
({
rules
:
{
resetpassword
:
{
required
:
true
,
},
},
messages
:
{
resetpassword
:
{
required
:
"Please enter your Username or email"
,
},
},
});
}
$
(
"body"
).
on
(
"click"
,
".eye_icon"
,
function
()
{
$
(
this
).
toggleClass
(
"eye_open"
);
var
input
=
$
(
"#pass_log_id"
);
if
(
input
.
attr
(
"type"
)
===
"password"
)
{
input
.
attr
(
"type"
,
"text"
);
}
else
{
input
.
attr
(
"type"
,
"password"
);
}
});
// ibv js file code here
if
(
$
(
".instaSlider"
).
length
)
{
$
(
".instaSlider"
).
slick
({
dots
:
false
,
arrows
:
false
,
infinite
:
false
,
slidesToShow
:
4
,
slidesToScroll
:
4
,
responsive
:
[
{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
slidesToShow
:
3
,
slidesToScroll
:
3
,
},
},
/* {
breakpoint: 576,
settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
}
} */
{
breakpoint
:
767
,
settings
:
"unslick"
,
/* settings: {
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
} */
},
],
});
}
var
getLength
=
$
(
".seoContentcon .listin_s_c_d"
).
length
;
if
(
getLength
>
"2"
)
{
$
(
".readMore_con"
).
addClass
(
"activeReadmore"
);
}
else
{
$
(
".readMore_con"
).
removeClass
(
"activeReadmore"
);
}
//$('.couponMobilecon').on('click', function(e){
$
(
document
).
on
(
"click"
,
".couponMobilecon"
,
function
()
{
$
(
this
).
parent
().
toggleClass
(
"activedropdown"
);
});
$
(
".readMore_con a"
).
on
(
"click"
,
function
()
{
var
listClass
=
$
(
this
)
.
parent
()
.
parents
(
".seoContentcon"
)
.
find
(
".listin_s_c_d"
);
listClass
.
toggleClass
(
"activeContent"
);
if
(
listClass
.
hasClass
(
"activeContent"
))
{
var
readless
=
$
(
this
).
data
(
"readless"
);
$
(
this
).
text
(
readless
);
}
else
{
var
readmore
=
$
(
this
).
data
(
"readmore"
);
$
(
this
).
text
(
readmore
);
}
});
$
(
".listing_c_p li"
).
on
(
"click"
,
function
()
{
$
(
this
).
toggleClass
(
"activeCheckbox"
);
if
(
$
(
this
).
hasClass
(
"activeCheckbox"
))
{
$
(
this
).
find
(
'input[type="checkbox"]'
).
prop
(
"checked"
,
true
);
}
else
{
$
(
this
).
find
(
'input[type="checkbox"]'
).
prop
(
"checked"
,
false
);
}
});
/* if($('#leftSidebar').length){
if($(window).width() >= 768){
var a = new StickySidebar('#leftSidebar', {
topSpacing: 20,
bottomSpacing: 20,
containerSelector: '.container',
innerWrapperSelector: '.sidebar__inner'
});
}
else{
console.log("sticky will not work");
}
} */
/* var offset = $("#leftSidebar").offset();
var topPadding = 15;
$(window).scroll(function() {
if ($(window).scrollTop() > offset.top) {
$("#leftSidebar").stop().animate({
marginTop: $(window).scrollTop() - offset.top + topPadding
});
} else {
$("#leftSidebar").stop().animate({
marginTop: 0
});
};
}); */
/* $('.c_smg').on('click', function() {
var a = $(this).parents('.r_c_b_cl').hide();
})
$('.b_m_c_b span').on('click', function() {
$(this).parents('body').addClass('scrollNone');
$(this).parents('.mob_strip_con').find('.navBar_menu').addClass('activeNav');
});
$('.mob_nav_close').on('click', function() {
$(this).parents('body').removeClass('scrollNone');
$(this).parents('.navBar_menu').removeClass('activeNav');
});
$('.dropdownMenuBtn').on('click', function() {
$(this).siblings('.mobDropdownmenu').slideToggle();
}); */
// nw code start
if
(
$
(
".nw_t_o_c"
).
length
)
{
$
(
".nw_t_o_c"
).
slick
({
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
1
,
slidesToScroll
:
1
,
});
}
if
(
$
(
"#contact_lp"
).
length
)
{
jQuery
.
validator
.
addMethod
(
"customEmail"
,
function
(
value
,
element
)
{
return
(
this
.
optional
(
element
)
||
/^
[
a-zA-Z0-9._-
]
+@
[
a-zA-Z0-9.-
]
+
\.[
a-zA-Z
]{2,4}
$/i
.
test
(
value
)
);
},
"Please enter valid email address!"
);
$
(
"#contact_lp"
).
validate
({
rules
:
{
name
:
{
required
:
true
,
},
emailaddress
:
{
required
:
true
,
email
:
true
,
customEmail
:
true
,
},
contact_number
:
{
required
:
true
,
},
},
messages
:
{
name
:
{
required
:
"Please enter your name"
,
},
emailaddress
:
{
required
:
"Please enter email address"
,
email
:
"Please enter a valid email address"
,
},
contact_number
:
"Please enter your mobile number"
,
},
});
}
$
(
".sl_cb"
).
on
(
"click"
,
function
()
{
var
hHeight
=
$
(
".mainHeadercontainer"
).
outerHeight
();
var
a
=
$
(
this
).
offset
().
top
-
hHeight
;
$
(
"html, body"
).
animate
({
scrollTop
:
a
},
700
);
});
if
(
$
(
".ourteam"
).
length
)
{
$
(
".ourteam"
).
slick
({
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
3
,
slidesToScroll
:
3
,
responsive
:
[
{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
slidesToShow
:
2
,
slidesToScroll
:
2
,
},
},
{
breakpoint
:
767
,
settings
:
{
arrows
:
true
,
slidesToShow
:
1
,
slidesToScroll
:
1
,
},
},
],
});
}
if
(
$
(
".slider_sl"
).
length
)
{
$
(
".slider_sl"
).
slick
({
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
1
,
slidesToScroll
:
1
});
}
var
$sticky
=
$
(
'.sticky'
);
var
$stickyrStopper
=
$
(
'.sticky-stopper'
);
if
(
$sticky
.
offset
())
{
var
generalSidebarHeight
=
$sticky
.
innerHeight
();
var
stickyTop
=
$sticky
.
offset
().
top
;
var
stickOffset
=
0
;
var
stickyStopperPosition
=
$stickyrStopper
.
offset
().
top
;
//console.log(stickyStopperPosition);
console
.
log
(
generalSidebarHeight
)
var
stopPoint
=
stickyStopperPosition
-
generalSidebarHeight
-
stickOffset
;
var
diff
=
stopPoint
+
stickOffset
;
console
.
log
(
stickyTop
)
$
(
window
).
scroll
(
function
(){
var
windowTop
=
$
(
window
).
scrollTop
();
var
windowWidth
=
$
(
window
).
width
();
var
innerWidth
=
$
(
'.fixedHeadercontainer'
).
innerHeight
();
innerWidth
=
innerWidth
+
30
;
if
(
windowWidth
>
767
)
{
if
(
stopPoint
<
windowTop
)
{
$sticky
.
css
({
position
:
'relative'
,
top
:
'100%'
,
'margin-top'
:
-
(
generalSidebarHeight
+
70
)});
}
else
if
(
stickyTop
<
windowTop
+
stickOffset
)
{
$sticky
.
css
({
position
:
'fixed'
,
top
:
stickOffset
+
innerWidth
,
'margin-top'
:
0
});
}
else
{
$sticky
.
css
({
position
:
'absolute'
,
top
:
'initial'
,
'margin-top'
:
0
});
}
}
});
}
if
(
$
(
".b_slider_m_c_box"
).
length
)
{
$
(
".b_slider_m_c_box"
).
slick
({
dots
:
false
,
arrows
:
true
,
infinite
:
false
,
slidesToShow
:
4
,
slidesToScroll
:
4
,
nextArrow
:
'<button class="arrowSlider leftArrow"><i class="fa fa-chevron-left" aria-hidden="true"></i><button>'
,
prevArrow
:
'<button class="arrowSlider rightArrow"><i class="fa fa-chevron-right" aria-hidden="true"></i><button>'
,
responsive
:
[{
breakpoint
:
991
,
settings
:
{
arrows
:
true
,
slidesToShow
:
3
,
slidesToScroll
:
3
,
},
},
{
breakpoint
:
767
,
settings
:
"unslick"
},
],
});
//when the slick slide initializes we want to set all of our slides to the same height
$
(
".b_slider_m_c_box"
).
on
(
"setPosition"
,
function
()
{
jbResizeSlider
();
});
//we need to maintain a set height when a resize event occurs.
//Some events will through a resize trigger: $(window).trigger('resize');
$
(
window
).
on
(
"resize"
,
function
(
e
)
{
jbResizeSlider
();
});
//since multiple events can trigger a slider adjustment, we will control that adjustment here
function
jbResizeSlider
()
{
$slickSlider
=
$
(
".b_slider_m_c_box"
);
$slickSlider
.
find
(
".slick-slide"
).
height
(
"auto"
);
var
slickTrack
=
$slickSlider
.
find
(
".slick-track"
);
var
slickTrackHeight
=
$
(
slickTrack
).
height
();
$slickSlider
.
find
(
".slick-slide"
).
css
(
"height"
,
slickTrackHeight
+
"px"
);
}
}
/*Manzar added code for video*/
$
(
'.rbc_slider_b'
).
slick
({
slidesToShow
:
1
,
slidesToScroll
:
1
,
arrows
:
false
,
fade
:
true
,
asNavFor
:
'.rbc_slider_s'
}).
on
(
'beforeChange'
,
function
(
event
,
slick
,
currentSlide
,
nextSlide
)
{
var
current
=
$
(
slick
.
$slides
[
currentSlide
]);
current
.
html
(
current
.
html
());
});
$
(
'.rbc_slider_s'
).
slick
({
slidesToShow
:
5
,
slidesToScroll
:
1
,
asNavFor
:
'.rbc_slider_b'
,
dots
:
false
,
focusOnSelect
:
true
,
vertical
:
true
,
verticalSwiping
:
true
,
nextArrow
:
'<button class="arrowSlider leftArrow"><i class="fa fa-chevron-left" aria-hidden="true"></i><button>'
,
prevArrow
:
'<button class="arrowSlider rightArrow"><i class="fa fa-chevron-right" aria-hidden="true"></i><button>'
,
responsive
:
[{
breakpoint
:
767
,
settings
:
{
vertical
:
false
,
slidesToShow
:
3
,
slidesToScroll
:
1
,
}
}]
});
/*Life at dic*/
$
(
'.scroll-pane'
).
jScrollPane
(
{
showArrows
:
false
,
horizontalGutter
:
100
,
verticalGutter
:
100
,
//mouseWheelSpeed: 50
}
);
var
getLength
=
$
(
'.count_li_item'
).
find
(
'li'
).
length
;
$
(
'.strip_c_line span'
).
css
({
'width'
:(
getLength
*
200
)
+
'px'
})
/*Manzar Code ended*/
$
(
".subheadings-list li a"
).
on
(
"click"
,
function
(
event
)
{
event
.
preventDefault
();
//$(this).parent().addClass("activeLink").siblings().removeClass('activeLink');
var
hHeight
=
$
(
".mainHeadercontainer"
).
outerHeight
();
var
dataContent
=
$
(
this
).
attr
(
'page-event'
);
var
b
=
$
(
'.ba_r_cb'
).
find
(
'.'
+
dataContent
);
console
.
log
(
dataContent
);
console
.
log
(
b
)
var
a
=
b
.
offset
().
top
-
hHeight
-
25
;
$
(
"html, body"
).
animate
({
scrollTop
:
a
},
700
);
});
console
.
log
(
"header"
);
// search button function start
$
(
'.h_search_dta'
).
on
(
'click'
,
function
(){
$
(
this
).
parents
(
'body'
).
addClass
(
'h_scrollNone'
).
find
(
'.h_site_search'
).
show
();
});
$
(
document
).
click
(
function
(
e
)
{
if
(
!
$
(
e
.
target
).
is
(
'.hh_site_search_box *, .hh_site_search_box, .h_search_dta, .h_search_dta *'
))
{
$
(
'body'
).
removeClass
(
'h_scrollNone'
).
find
(
'.h_site_search'
).
hide
();
}
});
// search button function end
// change region button function start
$
(
'.h_cr_b a'
).
on
(
'click'
,
function
(
e
){
e
.
preventDefault
();
$
(
this
).
parents
(
'body'
).
addClass
(
'h_scrollNone'
).
find
(
'.h_header_langBox'
).
show
();
});
$
(
document
).
click
(
function
(
e
)
{
if
(
!
$
(
e
.
target
).
is
(
'.h_cr_b *, .h_cr_b, .h_header_langBox_box, .h_header_langBox_box *'
))
{
$
(
'body'
).
removeClass
(
'h_scrollNone'
).
find
(
'.h_header_langBox'
).
hide
();
}
});
// change region button function end
$
(
'.h_menu_btn'
).
on
(
'click'
,
function
(
e
){
var
a
=
$
(
this
);
if
(
a
.
hasClass
(
"open"
))
{
a
.
parents
(
'body'
).
removeClass
(
'menu_body_scrollNone'
);
$
(
this
).
removeClass
(
'open'
).
parents
(
'.h_rc_b'
).
removeClass
(
'activeMenucon'
);
}
else
{
a
.
parents
(
'body'
).
addClass
(
'menu_body_scrollNone'
);
$
(
this
).
addClass
(
'open'
).
parents
(
'.h_rc_b'
).
addClass
(
'activeMenucon'
);
}
});
$
(
'.h_nav_main li em'
).
on
(
'click'
,
function
(
e
){
$
(
this
).
parents
(
'li'
).
toggleClass
(
'activeSM'
).
siblings
().
removeClass
(
'activeSM'
);
});
// menu container code start
//activeSM
/* const $menuBtn = document.querySelector(".menu-btn");
let isMenuOpen = false;
$menuBtn.addEventListener("click", () => {
if (!isMenuOpen) {
$menuBtn.classList.add("open");
} else {
$menuBtn.classList.remove("open");
}
isMenuOpen = !isMenuOpen;
}); */
$
(
'.f_l_cb .h6_h_c'
).
on
(
'click'
,
function
(){
var
a
=
$
(
this
).
parent
().
find
(
"ul"
);
$
(
this
).
parents
(
'.f_cb_m'
).
siblings
(
'.f_cb_m'
).
find
(
'.f_l_cb'
).
removeClass
(
'activeMenu'
).
find
(
'ul'
).
slideUp
();
$
(
this
).
parent
().
siblings
(
'.f_l_cb'
).
removeClass
(
'activeMenu'
).
find
(
'ul'
).
slideUp
();
if
(
a
.
is
(
":visible"
))
{
$
(
this
).
parent
().
find
(
'ul'
).
slideUp
();
$
(
this
).
parent
().
removeClass
(
'activeMenu'
);
}
else
{
$
(
this
).
parent
().
find
(
'ul'
).
slideDown
();
$
(
this
).
parent
().
addClass
(
'activeMenu'
);
}
});
...
...
themes/custom/envigo/js/override.js
0 → 100644
View file @
551b764e
(
function
(
$
)
{
console
.
log
(
"header"
);
// search button function start
$
(
'.h_search_dta'
).
on
(
'click'
,
function
()
{
$
(
this
).
parents
(
'body'
).
addClass
(
'h_scrollNone'
).
find
(
'.h_site_search'
).
show
();
});
$
(
document
).
click
(
function
(
e
)
{
if
(
!
$
(
e
.
target
).
is
(
'.hh_site_search_box *, .hh_site_search_box, .h_search_dta, .h_search_dta *'
))
{
$
(
'body'
).
removeClass
(
'h_scrollNone'
).
find
(
'.h_site_search'
).
hide
();
}
});
// search button function end
// change region button function start
$
(
'.h_cr_b a'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
parents
(
'body'
).
addClass
(
'h_scrollNone'
).
find
(
'.h_header_langBox'
).
show
();
});
$
(
document
).
click
(
function
(
e
)
{
if
(
!
$
(
e
.
target
).
is
(
'.h_cr_b *, .h_cr_b, .h_header_langBox_box, .h_header_langBox_box *'
))
{
$
(
'body'
).
removeClass
(
'h_scrollNone'
).
find
(
'.h_header_langBox'
).
hide
();
}
});
// change region button function end
$
(
'.h_menu_btn'
).
on
(
'click'
,
function
(
e
)
{
var
a
=
$
(
this
);
if
(
a
.
hasClass
(
"open"
))
{
a
.
parents
(
'body'
).
removeClass
(
'menu_body_scrollNone'
);
$
(
this
).
removeClass
(
'open'
).
parents
(
'.h_rc_b'
).
removeClass
(
'activeMenucon'
);
}
else
{
a
.
parents
(
'body'
).
addClass
(
'menu_body_scrollNone'
);
$
(
this
).
addClass
(
'open'
).
parents
(
'.h_rc_b'
).
addClass
(
'activeMenucon'
);
}
});
$
(
'.h_nav_main li em'
).
on
(
'click'
,
function
(
e
)
{
$
(
this
).
parents
(
'li'
).
toggleClass
(
'activeSM'
).
siblings
().
removeClass
(
'activeSM'
);
});
console
.
log
(
"footer"
);
$
(
'.f_l_cb .h6_h_c'
).
on
(
'click'
,
function
()
{
var
a
=
$
(
this
).
parent
().
find
(
"ul"
);
$
(
this
).
parents
(
'.f_cb_m'
).
siblings
(
'.f_cb_m'
).
find
(
'.f_l_cb'
).
removeClass
(
'activeMenu'
).
find
(
'ul'
).
slideUp
();
$
(
this
).
parent
().
siblings
(
'.f_l_cb'
).
removeClass
(
'activeMenu'
).
find
(
'ul'
).
slideUp
();
if
(
a
.
is
(
":visible"
))
{
$
(
this
).
parent
().
find
(
'ul'
).
slideUp
();
$
(
this
).
parent
().
removeClass
(
'activeMenu'
);
}
else
{
$
(
this
).
parent
().
find
(
'ul'
).
slideDown
();
$
(
this
).
parent
().
addClass
(
'activeMenu'
);
}
});
})(
jQuery
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment