Version Description
myStickyelements now works out-of-the-box with the following themes (which means you don't need to find your menu's class, it should work right after installation): Twenty Nineteen, Twenty Seventeen, Hello Elementor, OceanWP, Astra, Storefront, Twenty Sixteen, Neve, Hestia, Sydney, Shapely, GeneratePress, Mesmerize, Ashe, and Total. We've also added Google Lighthouse compatibility
Download this release
Release Info
Developer | galdub |
Plugin | myStickymenu |
Version | 2.2.5 |
Comparing to | |
See all releases |
Code changes from version 2.2.4 to 2.2.5
- class-review-box.php +211 -0
- css/mystickymenu-admin.css +60 -7
- images/premio-owner.png +0 -0
- js/mystickymenu-admin.js +50 -2
- mystickymenu.php +229 -7
- readme.txt +4 -2
- welcome-bar.php +137 -85
class-review-box.php
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class myStickymenu_review_box {
|
3 |
+
|
4 |
+
public $plugin_name = "myStickymenu";
|
5 |
+
|
6 |
+
public $plugin_slug = "my-sticky-menu";
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
|
10 |
+
add_action("wp_ajax_".$this->plugin_slug."_review_box", array($this, "affiliate_program"));
|
11 |
+
|
12 |
+
add_action('admin_notices', array($this, 'admin_notices'));
|
13 |
+
}
|
14 |
+
|
15 |
+
public function affiliate_program() {
|
16 |
+
$nonce = filter_input(INPUT_POST, 'nonce', FILTER_SANITIZE_STRING);
|
17 |
+
$days = filter_input(INPUT_POST, 'days', FILTER_SANITIZE_STRING);
|
18 |
+
if(!empty($nonce) && wp_verify_nonce($nonce, $this->plugin_slug."_review_box")) {
|
19 |
+
if($days == -1) {
|
20 |
+
add_option($this->plugin_slug."_hide_review_box", "1");
|
21 |
+
} else {
|
22 |
+
$date = date("Y-m-d", strtotime("+".$days." days"));
|
23 |
+
update_option($this->plugin_slug."_show_review_box_after", $date);
|
24 |
+
}
|
25 |
+
}
|
26 |
+
die;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function admin_notices() {
|
30 |
+
$is_hidden = get_option($this->plugin_slug."_hide_review_box");
|
31 |
+
if($is_hidden !== false) {
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
$current_count = get_option($this->plugin_slug."_show_review_box_after");
|
35 |
+
if($current_count === false) {
|
36 |
+
$date = date("Y-m-d", strtotime("+7 days"));
|
37 |
+
add_option($this->plugin_slug."_show_review_box_after", $date);
|
38 |
+
return;
|
39 |
+
} else if($current_count < 35) {
|
40 |
+
return;
|
41 |
+
}
|
42 |
+
$date_to_show = get_option($this->plugin_slug."_show_review_box_after");
|
43 |
+
if($date_to_show !== false) {
|
44 |
+
$current_date = date("Y-m-d");
|
45 |
+
if($current_date < $date_to_show) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
?>
|
50 |
+
<style>
|
51 |
+
.<?php echo $this->plugin_slug ?>-premio-review-box p a {
|
52 |
+
display: inline-block;
|
53 |
+
float: right;
|
54 |
+
text-decoration: none;
|
55 |
+
color: #999999;
|
56 |
+
position: absolute;
|
57 |
+
right: 12px;
|
58 |
+
top: 12px;
|
59 |
+
}
|
60 |
+
.<?php echo $this->plugin_slug ?>-premio-review-box p a:hover, .<?php echo $this->plugin_slug ?>-premio-review-box p a:focus {
|
61 |
+
color: #333333;
|
62 |
+
}
|
63 |
+
.<?php echo $this->plugin_slug ?>-premio-review-box .button span {
|
64 |
+
display: inline-block;
|
65 |
+
line-height: 27px;
|
66 |
+
font-size: 16px;
|
67 |
+
}
|
68 |
+
.<?php echo $this->plugin_slug ?>-review-box-popup {
|
69 |
+
position: fixed;
|
70 |
+
width: 100%;
|
71 |
+
height: 100%;
|
72 |
+
z-index: 10001;
|
73 |
+
background: rgba(0,0,0,0.65);
|
74 |
+
top: 0;
|
75 |
+
left: 0;
|
76 |
+
display: none;
|
77 |
+
}
|
78 |
+
.<?php echo $this->plugin_slug ?>-review-box-popup-content {
|
79 |
+
background: #ffffff;
|
80 |
+
padding: 20px;
|
81 |
+
position: absolute;
|
82 |
+
max-width: 450px;
|
83 |
+
width: 100%;
|
84 |
+
margin: 0 auto;
|
85 |
+
top: 45%;
|
86 |
+
left: 0;
|
87 |
+
right: 0;
|
88 |
+
-webkit-border-radius: 5px;
|
89 |
+
-moz-border-radius: 5px;
|
90 |
+
border-radius: 5px;: ;
|
91 |
+
}
|
92 |
+
.<?php echo $this->plugin_slug ?>-review-box-title {
|
93 |
+
padding: 0 0 10px 0;
|
94 |
+
font-weight: bold;
|
95 |
+
}
|
96 |
+
.<?php echo $this->plugin_slug ?>-review-box-options a {
|
97 |
+
display: block;
|
98 |
+
margin: 5px 0 5px 0;
|
99 |
+
color: #333;
|
100 |
+
text-decoration: none;
|
101 |
+
}
|
102 |
+
.<?php echo $this->plugin_slug ?>-review-box-options a.dismiss {
|
103 |
+
color: #999;
|
104 |
+
}
|
105 |
+
.<?php echo $this->plugin_slug ?>-review-box-options a:hover, .affiliate-options a:focus {
|
106 |
+
color: #0073aa;
|
107 |
+
}
|
108 |
+
button.<?php echo $this->plugin_slug ?>-close-review-box-popup {
|
109 |
+
position: absolute;
|
110 |
+
top: 5px;
|
111 |
+
right: 0;
|
112 |
+
border: none;
|
113 |
+
background: transparent;
|
114 |
+
cursor: pointer;
|
115 |
+
}
|
116 |
+
a.button.button-primary.<?php echo $this->plugin_slug ?>-review-box-btn {
|
117 |
+
font-size: 14px;
|
118 |
+
background: #F51366;
|
119 |
+
color: #fff;
|
120 |
+
border: solid 1px #F51366;
|
121 |
+
border-radius: 3px;
|
122 |
+
line-height: 24px;
|
123 |
+
-webkit-box-shadow: 0 3px 5px -3px #333333;
|
124 |
+
-moz-box-shadow: 0 3px 5px -3px #333333;
|
125 |
+
box-shadow: 0 3px 5px -3px #333333;
|
126 |
+
text-shadow: none;
|
127 |
+
}
|
128 |
+
.notice.notice-info.premio-notice {
|
129 |
+
position: relative;
|
130 |
+
padding: 1px 30px 1px 12px;
|
131 |
+
}
|
132 |
+
.notice.notice-info.premio-notice ul li {
|
133 |
+
margin: 0;
|
134 |
+
}
|
135 |
+
.notice.notice-info.premio-notice ul li a {
|
136 |
+
color: #0073aa;
|
137 |
+
font-size: 14px;
|
138 |
+
text-decoration: underline;
|
139 |
+
}
|
140 |
+
.<?php echo $this->plugin_slug ?>-premio-review-box p {
|
141 |
+
display: inline-block;
|
142 |
+
line-height: 30px;
|
143 |
+
vertical-align: middle;
|
144 |
+
padding: 0 10px 0 0;
|
145 |
+
}
|
146 |
+
.<?php echo $this->plugin_slug ?>-premio-review-box p img {
|
147 |
+
width: 30px;
|
148 |
+
height: 30px;
|
149 |
+
display: inline-block;
|
150 |
+
margin: 0 10px;
|
151 |
+
vertical-align: middle;
|
152 |
+
border-radius: 15px;
|
153 |
+
}
|
154 |
+
</style>
|
155 |
+
<div class="notice notice-info premio-notice <?php echo $this->plugin_slug ?>-premio-review-box <?php echo $this->plugin_slug ?>-premio-review-box">
|
156 |
+
<p>
|
157 |
+
Hi there, it seems like <b><?php echo $this->plugin_name ?></b> is bringing you some value, and that's pretty awesome! Can you please show us some love and rate <?php echo $this->plugin_name ?> on WordPress? It'll only take 2 minutes of your time, and will really help us spread the word
|
158 |
+
- <b>Gal Dubinski</b>, Co-founder <img width="30px" src="<?php echo esc_url(plugin_dir_url(__FILE__)."images/premio-owner.png") ?>" />
|
159 |
+
<a href="javascript:;" class="dismiss-btn <?php echo $this->plugin_slug ?>-premio-review-dismiss-btn"><span class="dashicons dashicons-no-alt"></span></a>
|
160 |
+
</p>
|
161 |
+
<div class="clear clearfix"></div>
|
162 |
+
<ul>
|
163 |
+
<li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn" href="https://wordpress.org/support/plugin/mystickymenu/reviews/?filter=5" target="_blank">I'd love to help :)</a></li>
|
164 |
+
<li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-future-btn" href="javascript:;">Not this time</a></li>
|
165 |
+
<li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn" href="javascript:;">I've already rated you</a></li>
|
166 |
+
</ul>
|
167 |
+
</div>
|
168 |
+
<div class="<?php echo $this->plugin_slug ?>-review-box-popup">
|
169 |
+
<div class="<?php echo $this->plugin_slug ?>-review-box-popup-content">
|
170 |
+
<button class="<?php echo $this->plugin_slug ?>-close-review-box-popup"><span class="dashicons dashicons-no-alt"></span></button>
|
171 |
+
<div class="<?php echo $this->plugin_slug ?>-review-box-title">Would you like us to remind you about this later?</div>
|
172 |
+
<div class="<?php echo $this->plugin_slug ?>-review-box-options">
|
173 |
+
<a href="javascript:;" data-days="3">Remind me in 3 days</a>
|
174 |
+
<a href="javascript:;" data-days="10">Remind me in 10 days</a>
|
175 |
+
<a href="javascript:;" data-days="-1" class="dismiss">Don't remind me about this</a>
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
</div>
|
179 |
+
<script>
|
180 |
+
jQuery(document).ready(function(){
|
181 |
+
jQuery("body").addClass("has-premio-box");
|
182 |
+
jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-premio-review-dismiss-btn, .<?php echo $this->plugin_slug ?>-premio-review-box-future-btn", function(){
|
183 |
+
jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").show();
|
184 |
+
});
|
185 |
+
jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-close-review-box-popup", function(){
|
186 |
+
jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").hide();
|
187 |
+
});
|
188 |
+
jQuery(document).on("click",".<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn",function(){
|
189 |
+
jQuery(".<?php echo $this->plugin_slug ?>-review-box-options a:last").trigger("click");
|
190 |
+
});
|
191 |
+
jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-review-box-options a", function(){
|
192 |
+
var dataDays = jQuery(this).attr("data-days");
|
193 |
+
jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
|
194 |
+
jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
|
195 |
+
jQuery("body").removeClass("has-premio-box");
|
196 |
+
jQuery.ajax({
|
197 |
+
url: "<?php echo admin_url("admin-ajax.php") ?>",
|
198 |
+
data: "action=<?php echo esc_attr($this->plugin_slug) ?>_review_box&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_review_box")) ?>",
|
199 |
+
type: "post",
|
200 |
+
success: function() {
|
201 |
+
jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
|
202 |
+
jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
|
203 |
+
}
|
204 |
+
});
|
205 |
+
});
|
206 |
+
});
|
207 |
+
</script>
|
208 |
+
<?php
|
209 |
+
}
|
210 |
+
}
|
211 |
+
$myStickymenu_review_box = new myStickymenu_review_box();
|
css/mystickymenu-admin.css
CHANGED
@@ -1502,6 +1502,7 @@ p.udner-title {
|
|
1502 |
border: 1px solid #E1E6E6;
|
1503 |
padding: 20px;
|
1504 |
border-radius: 7px;
|
|
|
1505 |
}
|
1506 |
.mysticky-welcomebar-header-title h3 {
|
1507 |
margin: 0;
|
@@ -1645,7 +1646,7 @@ a.create-rule {
|
|
1645 |
.mysticky-welcomebar-upgrade-main {
|
1646 |
position: relative;
|
1647 |
vertical-align: top;
|
1648 |
-
width:
|
1649 |
padding-right: 10px;
|
1650 |
padding-bottom: 0;
|
1651 |
}
|
@@ -1665,7 +1666,7 @@ a.create-rule {
|
|
1665 |
float: left;
|
1666 |
|
1667 |
}
|
1668 |
-
|
1669 |
.mysticky-welcomebar-page-option .url-content .mysticky-welcomebar-url-values,
|
1670 |
.mysticky-welcomebar-page-option .url-content .mysticky-welcomebar-url-option{
|
1671 |
width: 20%;
|
@@ -1675,15 +1676,67 @@ a.create-rule {
|
|
1675 |
text-align: right;
|
1676 |
margin-top: 10px;
|
1677 |
}
|
1678 |
-
|
|
|
1679 |
width: 120px;
|
1680 |
}
|
|
|
1681 |
.mysticky-welcomebar-page-option .url-content input[type="text"] {
|
1682 |
height: 38px;
|
1683 |
padding: 0 15px;
|
1684 |
border-radius: 0;
|
1685 |
}
|
1686 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1687 |
color: #fff;
|
1688 |
background-color: #666;
|
1689 |
text-decoration: none;
|
@@ -1701,9 +1754,9 @@ a.create-rule {
|
|
1701 |
vertical-align: top;
|
1702 |
}
|
1703 |
.mysticky-welcomebar-setting-right {
|
1704 |
-
position:
|
1705 |
-
top:
|
1706 |
-
right:
|
1707 |
width: 500px;
|
1708 |
}
|
1709 |
.mysticky-welcomebar-header-title::after {
|
1502 |
border: 1px solid #E1E6E6;
|
1503 |
padding: 20px;
|
1504 |
border-radius: 7px;
|
1505 |
+
position: relative;
|
1506 |
}
|
1507 |
.mysticky-welcomebar-header-title h3 {
|
1508 |
margin: 0;
|
1646 |
.mysticky-welcomebar-upgrade-main {
|
1647 |
position: relative;
|
1648 |
vertical-align: top;
|
1649 |
+
width: 100%;
|
1650 |
padding-right: 10px;
|
1651 |
padding-bottom: 0;
|
1652 |
}
|
1666 |
float: left;
|
1667 |
|
1668 |
}
|
1669 |
+
|
1670 |
.mysticky-welcomebar-page-option .url-content .mysticky-welcomebar-url-values,
|
1671 |
.mysticky-welcomebar-page-option .url-content .mysticky-welcomebar-url-option{
|
1672 |
width: 20%;
|
1676 |
text-align: right;
|
1677 |
margin-top: 10px;
|
1678 |
}
|
1679 |
+
|
1680 |
+
/*.mysticky-welcomebar-page-option .url-content select {
|
1681 |
width: 120px;
|
1682 |
}
|
1683 |
+
*/
|
1684 |
.mysticky-welcomebar-page-option .url-content input[type="text"] {
|
1685 |
height: 38px;
|
1686 |
padding: 0 15px;
|
1687 |
border-radius: 0;
|
1688 |
}
|
1689 |
+
|
1690 |
+
.mysticky-page-option .myStickymenu-upgrade {
|
1691 |
+
float: none;
|
1692 |
+
position: absolute;
|
1693 |
+
top: 0;
|
1694 |
+
left: 0;
|
1695 |
+
right: 0;
|
1696 |
+
text-align: center;
|
1697 |
+
background-color: rgba(0,0,0,0.6);
|
1698 |
+
bottom: 0;
|
1699 |
+
border-radius: 10px;
|
1700 |
+
display: flex;
|
1701 |
+
align-items: center;
|
1702 |
+
justify-content: center;
|
1703 |
+
}
|
1704 |
+
.mysticky-page-option {
|
1705 |
+
background-color: #fff;
|
1706 |
+
padding: 10px;
|
1707 |
+
margin-bottom: 10px;
|
1708 |
+
border: 1px solid #DCE2E2;
|
1709 |
+
border-radius: 10px;
|
1710 |
+
position: relative;
|
1711 |
+
}
|
1712 |
+
.mysticky-page-option .url-content {
|
1713 |
+
display: flex;
|
1714 |
+
align-items: center;
|
1715 |
+
}
|
1716 |
+
.mysticky-page-option .url-content > div {
|
1717 |
+
padding: 0 5px;
|
1718 |
+
}
|
1719 |
+
.mysticky-page-option .url-content > div.mysticky-welcomebar-url-box {
|
1720 |
+
width: 260px;
|
1721 |
+
text-align: right;
|
1722 |
+
}
|
1723 |
+
.mysticky-page-option .url-content > div.mysticky-welcomebar-url-box {
|
1724 |
+
width: 300px;
|
1725 |
+
}
|
1726 |
+
.mysticky-page-option .url-content select {
|
1727 |
+
width: 250px;
|
1728 |
+
}
|
1729 |
+
.mysticky-page-option .url-content input[type="text"] {
|
1730 |
+
height: 38px;
|
1731 |
+
padding: 0 15px;
|
1732 |
+
border-radius: 0;
|
1733 |
+
}
|
1734 |
+
.mystickymenu-page-target-wrap {
|
1735 |
+
padding-bottom: 20px;
|
1736 |
+
}
|
1737 |
+
|
1738 |
+
.mysticky-welcomebar-remove-rule ,
|
1739 |
+
.mysticky-remove-rule {
|
1740 |
color: #fff;
|
1741 |
background-color: #666;
|
1742 |
text-decoration: none;
|
1754 |
vertical-align: top;
|
1755 |
}
|
1756 |
.mysticky-welcomebar-setting-right {
|
1757 |
+
position: absolute;
|
1758 |
+
top: 32px;
|
1759 |
+
right: 50px;
|
1760 |
width: 500px;
|
1761 |
}
|
1762 |
.mysticky-welcomebar-header-title::after {
|
images/premio-owner.png
ADDED
Binary file
|
js/mystickymenu-admin.js
CHANGED
@@ -121,7 +121,8 @@
|
|
121 |
$( '#create-rule' ).on( 'click', function(){
|
122 |
var append_html = page_option_content.replace(/__count__/g, '1', page_option_content);
|
123 |
$( '.mysticky-welcomebar-page-options' ).append( append_html );
|
124 |
-
$(
|
|
|
125 |
});
|
126 |
$( '.sticky-header-menu ul li a' ).on( 'click', function(){
|
127 |
if ( $( "#sticky-header-welcome-bar" ).is( ":visible" ) ) {
|
@@ -133,6 +134,45 @@
|
|
133 |
check_for_preview_pos();
|
134 |
}
|
135 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
/* welcome bar live preview */
|
137 |
/* Apply Wp Color Picker */
|
138 |
var myOptions = {
|
@@ -246,8 +286,9 @@
|
|
246 |
});
|
247 |
});
|
248 |
function check_for_preview_pos() {
|
|
|
249 |
if($(".show-on-apper").length && $(".mysticky-welcomebar-setting-right").length) {
|
250 |
-
var topPos = $(".show-on-apper").offset().top - $(window).scrollTop() -
|
251 |
if (topPos < 0) {
|
252 |
topPos = Math.abs(topPos);
|
253 |
jQuery(".mysticky-welcomebar-setting-right").css("margin-top", ((-1)*topPos)+"px");
|
@@ -255,6 +296,13 @@
|
|
255 |
jQuery(".mysticky-welcomebar-setting-right").css("margin-top", "0");
|
256 |
}
|
257 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
}
|
259 |
|
260 |
})(jQuery);
|
121 |
$( '#create-rule' ).on( 'click', function(){
|
122 |
var append_html = page_option_content.replace(/__count__/g, '1', page_option_content);
|
123 |
$( '.mysticky-welcomebar-page-options' ).append( append_html );
|
124 |
+
$( '.mysticky-welcomebar-page-options' ).show();
|
125 |
+
$( this ).parent().remove();
|
126 |
});
|
127 |
$( '.sticky-header-menu ul li a' ).on( 'click', function(){
|
128 |
if ( $( "#sticky-header-welcome-bar" ).is( ":visible" ) ) {
|
134 |
check_for_preview_pos();
|
135 |
}
|
136 |
});
|
137 |
+
/*Mysticky page target*/
|
138 |
+
var mysticky_total_page_option = 0;
|
139 |
+
var mysticky_page_option_content = "";
|
140 |
+
mysticky_total_page_option = $( '.mysticky-page-option' ).length;
|
141 |
+
mysticky_page_option_content = $( '.mysticky-page-options-html' ).html();
|
142 |
+
$( '.mysticky-page-options-html' ).remove();
|
143 |
+
|
144 |
+
$( '#mysticky_create-rule' ).on( 'click', function(){
|
145 |
+
|
146 |
+
var append_html = mysticky_page_option_content.replace(/__count__/g, mysticky_total_page_option, mysticky_page_option_content);
|
147 |
+
mysticky_total_page_option++;
|
148 |
+
$( '.mysticky-page-options' ).append( append_html );
|
149 |
+
$( '.mysticky-page-options .mysticky-page-option' ).removeClass( 'last' );
|
150 |
+
$( '.mysticky-page-options .mysticky-page-option:last' ).addClass( 'last' );
|
151 |
+
|
152 |
+
if( $( '.mysticky-page-option .myStickymenu-upgrade' ).length > 0 ) {
|
153 |
+
$( this ).remove();
|
154 |
+
}
|
155 |
+
});
|
156 |
+
$( document ).on( 'click', '.mysticky-remove-rule', function() {
|
157 |
+
$( this ).closest( '.mysticky-page-option' ).remove();
|
158 |
+
$( '.mysticky-page-options .mysticky-page-option' ).removeClass( 'last' );
|
159 |
+
$( '.mysticky-page-options .mysticky-page-option:last' ).addClass( 'last' );
|
160 |
+
});
|
161 |
+
$( document ).on( 'change', '.mysticky-url-options', function() {
|
162 |
+
var current_val = jQuery( this ).val();
|
163 |
+
var mysticky_welcomebar_siteURL = jQuery( '#mysticky_welcomebar_site_url' ).val();
|
164 |
+
var mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL;
|
165 |
+
if( current_val == 'page_has_url' ) {
|
166 |
+
mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL;
|
167 |
+
} else if( current_val == 'page_contains' ) {
|
168 |
+
mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL + '%s%';
|
169 |
+
} else if( current_val == 'page_start_with' ) {
|
170 |
+
mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL + 's%';
|
171 |
+
} else if( current_val == 'page_end_with' ) {
|
172 |
+
mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL + '%s';
|
173 |
+
}
|
174 |
+
$( this ).closest( '.url-content' ).find( '.mysticky-welcomebar-url' ).text( mysticky_welcomebar_newURL );
|
175 |
+
});
|
176 |
/* welcome bar live preview */
|
177 |
/* Apply Wp Color Picker */
|
178 |
var myOptions = {
|
286 |
});
|
287 |
});
|
288 |
function check_for_preview_pos() {
|
289 |
+
var mysticky_welcomebar_form_pos = $( '#sticky-header-welcome-bar' ).offset().top;
|
290 |
if($(".show-on-apper").length && $(".mysticky-welcomebar-setting-right").length) {
|
291 |
+
var topPos = $(".show-on-apper").offset().top - $(window).scrollTop() - 700;
|
292 |
if (topPos < 0) {
|
293 |
topPos = Math.abs(topPos);
|
294 |
jQuery(".mysticky-welcomebar-setting-right").css("margin-top", ((-1)*topPos)+"px");
|
296 |
jQuery(".mysticky-welcomebar-setting-right").css("margin-top", "0");
|
297 |
}
|
298 |
}
|
299 |
+
if ( ( mysticky_welcomebar_form_pos + 32 ) < $(window).scrollTop() ) {
|
300 |
+
$( '.mysticky-welcomebar-setting-right' ).css( 'position', 'fixed' );
|
301 |
+
$( '.mysticky-welcomebar-setting-right' ).css( 'right', '70px' );
|
302 |
+
} else {
|
303 |
+
$( '.mysticky-welcomebar-setting-right' ).css( 'position', 'absolute' );
|
304 |
+
$( '.mysticky-welcomebar-setting-right' ).css( 'right', '50px' );
|
305 |
+
}
|
306 |
}
|
307 |
|
308 |
})(jQuery);
|
mystickymenu.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: myStickymenu
|
4 |
Plugin URI: https://premio.io/
|
5 |
Description: Simple sticky (fixed on top) menu implementation for navigation menu and Welcome bar for announcements and promotion. After install go to Settings / myStickymenu and change Sticky Class to .your_navbar_class or #your_navbar_id.
|
6 |
-
Version: 2.2.
|
7 |
Author: Premio
|
8 |
Author URI: https://premio.io/downloads/mystickymenu/
|
9 |
Text Domain: mystickymenu
|
@@ -12,10 +12,14 @@ License: GPLv2 or later
|
|
12 |
*/
|
13 |
|
14 |
defined('ABSPATH') or die("Cannot access pages directly.");
|
15 |
-
define( 'MYSTICKY_VERSION', '2.2.
|
16 |
require_once("mystickymenu-fonts.php");
|
17 |
require_once("welcome-bar.php");
|
18 |
|
|
|
|
|
|
|
|
|
19 |
class MyStickyMenuBackend
|
20 |
{
|
21 |
private $options;
|
@@ -159,7 +163,7 @@ class MyStickyMenuBackend
|
|
159 |
|
160 |
$mysticky_options = get_option( 'mysticky_option_name');
|
161 |
$is_old = get_option("has_sticky_header_old_version");
|
162 |
-
$is_old = ($is_old == "
|
163 |
$nonce = wp_create_nonce('mysticky_option_backend_update');
|
164 |
$pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=";
|
165 |
|
@@ -407,6 +411,94 @@ class MyStickyMenuBackend
|
|
407 |
</label>
|
408 |
</p>
|
409 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
<div class="mystickymenu-content-option">
|
411 |
<label class="mysticky_title css-style-title"><?php _e("CSS style", 'mystickymenu'); ?></label>
|
412 |
<span class="mysticky_text"><?php _e( 'Add/edit CSS style. Leave it blank for default style.', 'mystickymenu');?></span>
|
@@ -528,6 +620,7 @@ class MyStickyMenuBackend
|
|
528 |
<p></p>
|
529 |
</div>
|
530 |
</div>
|
|
|
531 |
</div>
|
532 |
<p class="submit">
|
533 |
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save', 'mystickymenu');?>">
|
@@ -564,7 +657,7 @@ class MyStickyMenuBackend
|
|
564 |
<div class="rpt_feature rpt_feature_0-1"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can show the menu when scrolling up, down or both</span>Show on scroll up/down<span class="rpt_tooltip_plus" > +</span></a></div>
|
565 |
<div class="rpt_feature rpt_feature_0-2"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can disable the sticky effect on desktop or mobile</span>Devices<span class="rpt_tooltip_plus" > +</span></a></div>
|
566 |
<div class="rpt_feature rpt_feature_0-3"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Add CSS of your own to the sticky menu</span>CSS style<span class="rpt_tooltip_plus" > +</span></a></div>
|
567 |
-
<div class="rpt_feature rpt_feature_0-4"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>
|
568 |
<div class="rpt_feature rpt_feature_0-5"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Fade/Slide, opacity, background color, transition time and more</span>Effects and more<span class="rpt_tooltip_plus" > +</span></a></div>
|
569 |
<div class="rpt_feature rpt_feature_0-6"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Including page targeting, delay and scroll triggers, devices, position, height, expiry date, open link in a new tab and remove credit</span>Welcome bar<span class="rpt_tooltip_plus"> +</span></a></div>
|
570 |
<div class="rpt_feature rpt_feature_0-9">
|
@@ -597,7 +690,7 @@ class MyStickyMenuBackend
|
|
597 |
<div class="rpt_feature rpt_feature_1-1"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can show the menu when scrolling up, down or both</span>Show on scroll up/down<span class="rpt_tooltip_plus" > +</span></a></div>
|
598 |
<div class="rpt_feature rpt_feature_1-2"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can disable the sticky effect on desktop or mobile</span>Devices<span class="rpt_tooltip_plus" > +</span></a></div>
|
599 |
<div class="rpt_feature rpt_feature_1-3"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Add CSS of your own to the sticky menu</span>CSS style<span class="rpt_tooltip_plus" > +</span></a></div>
|
600 |
-
<div class="rpt_feature rpt_feature_1-4"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>
|
601 |
<div class="rpt_feature rpt_feature_1-5"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Fade/Slide, opacity, background color, transition time and more</span>Effects and more<span class="rpt_tooltip_plus" > +</span></a></div>
|
602 |
<div class="rpt_feature rpt_feature_1-6"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Including page targeting, delay and scroll triggers, devices, position, height, expiry date, open link in a new tab and remove credit</span>Welcome bar<span class="rpt_tooltip_plus"> +</span></a></div>
|
603 |
<div class="rpt_feature rpt_feature_0-9">
|
@@ -630,7 +723,7 @@ class MyStickyMenuBackend
|
|
630 |
<div class="rpt_feature rpt_feature_2-1"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can show the menu when scrolling up, down or both</span>Show on scroll up/down<span class="rpt_tooltip_plus" > +</span></a></div>
|
631 |
<div class="rpt_feature rpt_feature_2-2"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can disable the sticky effect on desktop or mobile</span>Devices<span class="rpt_tooltip_plus" > +</span></a></div>
|
632 |
<div class="rpt_feature rpt_feature_2-3"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Add CSS of your own to the sticky menu</span>CSS style<span class="rpt_tooltip_plus" > +</span></a></div>
|
633 |
-
<div class="rpt_feature rpt_feature_2-4"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>
|
634 |
<div class="rpt_feature rpt_feature_2-5"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Fade/Slide, opacity, background color, transition time and more</span>Effects and more<span class="rpt_tooltip_plus" > +</span></a></div>
|
635 |
<div class="rpt_feature rpt_feature_2-6"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Including page targeting, delay and scroll triggers, devices, position, height, expiry date, open link in a new tab and remove credit</span>Welcome bar<span class="rpt_tooltip_plus"> +</span></a></div>
|
636 |
<div class="rpt_feature rpt_feature_0-9">
|
@@ -685,9 +778,66 @@ class MyStickyMenuBackend
|
|
685 |
} else {
|
686 |
$mysticky_class_id_selector = 'custom';
|
687 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
688 |
$default = array(
|
689 |
'mysticky_class_id_selector' => $mysticky_class_id_selector,
|
690 |
-
'mysticky_class_selector' =>
|
691 |
'device_desktop' => 'on',
|
692 |
'device_mobile' => 'on',
|
693 |
'myfixed_zindex' => '99990',
|
@@ -777,6 +927,32 @@ class MyStickyMenuFrontend
|
|
777 |
echo $mysticky_options ['myfixed_cssstyle'];
|
778 |
}
|
779 |
echo '</style>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
780 |
}
|
781 |
}
|
782 |
|
@@ -866,6 +1042,52 @@ class MyStickyMenuFrontend
|
|
866 |
$mystickyDisableLarge = isset($mysticky_options['myfixed_disable_large_screen']) ? $mysticky_options['myfixed_disable_large_screen'] : '0';
|
867 |
|
868 |
$mystickyClass = ( $mysticky_options['mysticky_class_id_selector'] != 'custom') ? '.menu-' . $mysticky_options['mysticky_class_id_selector'] .'-container' : $mysticky_options['mysticky_class_selector'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
869 |
|
870 |
$mysticky_translation_array = array(
|
871 |
'mystickyClass' => $mystickyClass,
|
3 |
Plugin Name: myStickymenu
|
4 |
Plugin URI: https://premio.io/
|
5 |
Description: Simple sticky (fixed on top) menu implementation for navigation menu and Welcome bar for announcements and promotion. After install go to Settings / myStickymenu and change Sticky Class to .your_navbar_class or #your_navbar_id.
|
6 |
+
Version: 2.2.5
|
7 |
Author: Premio
|
8 |
Author URI: https://premio.io/downloads/mystickymenu/
|
9 |
Text Domain: mystickymenu
|
12 |
*/
|
13 |
|
14 |
defined('ABSPATH') or die("Cannot access pages directly.");
|
15 |
+
define( 'MYSTICKY_VERSION', '2.2.5' );
|
16 |
require_once("mystickymenu-fonts.php");
|
17 |
require_once("welcome-bar.php");
|
18 |
|
19 |
+
if(is_admin()) {
|
20 |
+
include_once 'class-review-box.php';
|
21 |
+
}
|
22 |
+
|
23 |
class MyStickyMenuBackend
|
24 |
{
|
25 |
private $options;
|
163 |
|
164 |
$mysticky_options = get_option( 'mysticky_option_name');
|
165 |
$is_old = get_option("has_sticky_header_old_version");
|
166 |
+
$is_old = ($is_old == "yes")?true:false;
|
167 |
$nonce = wp_create_nonce('mysticky_option_backend_update');
|
168 |
$pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=";
|
169 |
|
411 |
</label>
|
412 |
</p>
|
413 |
</div>
|
414 |
+
<div class="mysticky-page-target-setting mystickymenu-content-option">
|
415 |
+
<label class="mysticky_title"><?php _e('Page targeting', 'myStickymenu'); ?></label>
|
416 |
+
<div class="mystickymenu-input-section mystickymenu-page-target-wrap">
|
417 |
+
<div class="mysticky-welcomebar-setting-content-right">
|
418 |
+
<div class="mysticky-page-options" id="mysticky-welcomebar-page-options">
|
419 |
+
<?php $page_option = (isset($mysticky_options['mysticky_page_settings'])) ? $mysticky_options['mysticky_page_settings'] : array();
|
420 |
+
$url_options = array(
|
421 |
+
'page_contains' => 'pages that contain',
|
422 |
+
'page_has_url' => 'a specific page',
|
423 |
+
'page_start_with' => 'pages starting with',
|
424 |
+
'page_end_with' => 'pages ending with',
|
425 |
+
);
|
426 |
+
|
427 |
+
if(!empty($page_option) && is_array($page_option)) {
|
428 |
+
$count = 0;
|
429 |
+
foreach($page_option as $k=>$option) {
|
430 |
+
$count++;
|
431 |
+
?>
|
432 |
+
<div class="mysticky-page-option <?php echo $k==count($page_option)?"last":""; ?>">
|
433 |
+
<div class="url-content">
|
434 |
+
<div class="mysticky-welcomebar-url-select">
|
435 |
+
<select name="mysticky_option_name[mysticky_page_settings][<?php echo $count; ?>][shown_on]" id="url_shown_on_<?php echo $count ?>_option">
|
436 |
+
<option value="show_on" <?php echo $option['shown_on']=="show_on"?"selected":"" ?> ><?php esc_html_e( 'Show on', 'mysticky' )?></option>
|
437 |
+
<option value="not_show_on" <?php echo $option['shown_on']=="not_show_on"?"selected":"" ?>><?php esc_html_e( "Don't show on", "mysticky" );?></option>
|
438 |
+
</select>
|
439 |
+
</div>
|
440 |
+
<div class="mysticky-welcomebar-url-option">
|
441 |
+
<select class="mysticky-url-options" name="mysticky_option_name[mysticky_page_settings][<?php echo $count; ?>][option]" id="url_rules_<?php echo $count ?>_option">
|
442 |
+
<option disabled value=""><?php esc_html_e( "Select Rule", "mysticky" );?></option>
|
443 |
+
<?php foreach($url_options as $key=>$value) {
|
444 |
+
$selected = ( isset($option['option']) && $option['option']==$key )?" selected='selected' ":"";
|
445 |
+
echo '<option '.$selected.' value="'.$key.'">'.$value.'</option>';
|
446 |
+
} ?>
|
447 |
+
</select>
|
448 |
+
</div>
|
449 |
+
<div class="mysticky-welcomebar-url-box">
|
450 |
+
<span class='mysticky-welcomebar-url'><?php echo site_url("/"); ?></span>
|
451 |
+
</div>
|
452 |
+
<div class="mysticky-welcomebar-url-values">
|
453 |
+
<input type="text" value="<?php echo $option['value'] ?>" name="mysticky_option_name[mysticky_page_settings][<?php echo $count; ?>][value]" id="url_rules_<?php echo $count; ?>_value" />
|
454 |
+
</div>
|
455 |
+
<div class="mysticky-welcomebar-url-buttons">
|
456 |
+
<a class="mysticky-remove-rule" href="javascript:;">x</a>
|
457 |
+
</div>
|
458 |
+
<div class="clear"></div>
|
459 |
+
</div>
|
460 |
+
</div>
|
461 |
+
<?php
|
462 |
+
}
|
463 |
+
}
|
464 |
+
?>
|
465 |
+
</div>
|
466 |
+
<a href="javascript:void(0);" class="create-rule" id="mysticky_create-rule"><?php esc_html_e( "Add Rule", "mystickyelements" );?></a>
|
467 |
+
</div>
|
468 |
+
<input type="hidden" id="mysticky_welcomebar_site_url" value="<?php echo site_url("/") ?>" />
|
469 |
+
<div class="mysticky-page-options-html" style="display: none;">
|
470 |
+
<div class="mysticky-page-option">
|
471 |
+
<div class="url-content">
|
472 |
+
<div class="mysticky-welcomebar-url-select">
|
473 |
+
<select name="mysticky_option_name[mysticky_page_settings][__count__][shown_on]" id="url_shown_on___count___option" <?php echo !$is_pro_active?"disabled":"" ?>>
|
474 |
+
<option value="show_on"><?php esc_html_e("Show on", "mysticky" );?></option>
|
475 |
+
<option value="not_show_on"><?php esc_html_e("Don't show on", "mysticky" );?></option>
|
476 |
+
</select>
|
477 |
+
</div>
|
478 |
+
<div class="mysticky-welcomebar-url-option">
|
479 |
+
<select class="mysticky-url-options" name="mysticky_option_name[mysticky_page_settings][__count__][option]" id="url_rules___count___option" <?php echo !$is_pro_active?"disabled":"" ?>>
|
480 |
+
<option selected="selected" disabled value=""><?php esc_html_e("Select Rule", "mysticky" );?></option>
|
481 |
+
<?php foreach($url_options as $key=>$value) {
|
482 |
+
echo '<option value="'.$key.'">'.$value.'</option>';
|
483 |
+
} ?>
|
484 |
+
</select>
|
485 |
+
</div>
|
486 |
+
<div class="mysticky-welcomebar-url-box">
|
487 |
+
<span class='mysticky-welcomebar-url'><?php echo site_url("/"); ?></span>
|
488 |
+
</div>
|
489 |
+
<div class="mysticky-welcomebar-url-values">
|
490 |
+
<input type="text" value="" name="mysticky_option_name[mysticky_page_settings][__count__][value]" id="url_rules___count___value" <?php echo !$is_pro_active?"disabled":"" ?> />
|
491 |
+
</div>
|
492 |
+
<div class="mysticky-welcomebar-url-buttons">
|
493 |
+
<a class="mysticky-remove-rule" href="javascript:void(0);">x</a>
|
494 |
+
</div>
|
495 |
+
<div class="clear"></div>
|
496 |
+
</div>
|
497 |
+
<?php if(!$is_old) { ?><span class="myStickymenu-upgrade"><a class="sticky-header-upgrade-now" href="#" target="_blank"><?php _e( 'Upgrade Now', 'mystickymenu' );?></a></span><?php } ?>
|
498 |
+
</div>
|
499 |
+
</div>
|
500 |
+
</div>
|
501 |
+
</div>
|
502 |
<div class="mystickymenu-content-option">
|
503 |
<label class="mysticky_title css-style-title"><?php _e("CSS style", 'mystickymenu'); ?></label>
|
504 |
<span class="mysticky_text"><?php _e( 'Add/edit CSS style. Leave it blank for default style.', 'mystickymenu');?></span>
|
620 |
<p></p>
|
621 |
</div>
|
622 |
</div>
|
623 |
+
|
624 |
</div>
|
625 |
<p class="submit">
|
626 |
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save', 'mystickymenu');?>">
|
657 |
<div class="rpt_feature rpt_feature_0-1"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can show the menu when scrolling up, down or both</span>Show on scroll up/down<span class="rpt_tooltip_plus" > +</span></a></div>
|
658 |
<div class="rpt_feature rpt_feature_0-2"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can disable the sticky effect on desktop or mobile</span>Devices<span class="rpt_tooltip_plus" > +</span></a></div>
|
659 |
<div class="rpt_feature rpt_feature_0-3"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Add CSS of your own to the sticky menu</span>CSS style<span class="rpt_tooltip_plus" > +</span></a></div>
|
660 |
+
<div class="rpt_feature rpt_feature_0-4"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Show/hide the sticky menu on specific pages</span>Page targeting<span class="rpt_tooltip_plus" > +</span></a></div>
|
661 |
<div class="rpt_feature rpt_feature_0-5"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Fade/Slide, opacity, background color, transition time and more</span>Effects and more<span class="rpt_tooltip_plus" > +</span></a></div>
|
662 |
<div class="rpt_feature rpt_feature_0-6"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Including page targeting, delay and scroll triggers, devices, position, height, expiry date, open link in a new tab and remove credit</span>Welcome bar<span class="rpt_tooltip_plus"> +</span></a></div>
|
663 |
<div class="rpt_feature rpt_feature_0-9">
|
690 |
<div class="rpt_feature rpt_feature_1-1"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can show the menu when scrolling up, down or both</span>Show on scroll up/down<span class="rpt_tooltip_plus" > +</span></a></div>
|
691 |
<div class="rpt_feature rpt_feature_1-2"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can disable the sticky effect on desktop or mobile</span>Devices<span class="rpt_tooltip_plus" > +</span></a></div>
|
692 |
<div class="rpt_feature rpt_feature_1-3"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Add CSS of your own to the sticky menu</span>CSS style<span class="rpt_tooltip_plus" > +</span></a></div>
|
693 |
+
<div class="rpt_feature rpt_feature_1-4"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Show/hide the sticky menu on specific pages</span>Page targeting<span class="rpt_tooltip_plus" > +</span></a></div>
|
694 |
<div class="rpt_feature rpt_feature_1-5"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Fade/Slide, opacity, background color, transition time and more</span>Effects and more<span class="rpt_tooltip_plus" > +</span></a></div>
|
695 |
<div class="rpt_feature rpt_feature_1-6"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Including page targeting, delay and scroll triggers, devices, position, height, expiry date, open link in a new tab and remove credit</span>Welcome bar<span class="rpt_tooltip_plus"> +</span></a></div>
|
696 |
<div class="rpt_feature rpt_feature_0-9">
|
723 |
<div class="rpt_feature rpt_feature_2-1"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can show the menu when scrolling up, down or both</span>Show on scroll up/down<span class="rpt_tooltip_plus" > +</span></a></div>
|
724 |
<div class="rpt_feature rpt_feature_2-2"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>You can disable the sticky effect on desktop or mobile</span>Devices<span class="rpt_tooltip_plus" > +</span></a></div>
|
725 |
<div class="rpt_feature rpt_feature_2-3"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Add CSS of your own to the sticky menu</span>CSS style<span class="rpt_tooltip_plus" > +</span></a></div>
|
726 |
+
<div class="rpt_feature rpt_feature_2-4"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Show/hide the sticky menu on specific pages</span>Page targeting<span class="rpt_tooltip_plus" > +</span></a></div>
|
727 |
<div class="rpt_feature rpt_feature_2-5"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Fade/Slide, opacity, background color, transition time and more</span>Effects and more<span class="rpt_tooltip_plus" > +</span></a></div>
|
728 |
<div class="rpt_feature rpt_feature_2-6"><a href="javascript:;" class="rpt_tooltip"><span class="intool"><b></b>Including page targeting, delay and scroll triggers, devices, position, height, expiry date, open link in a new tab and remove credit</span>Welcome bar<span class="rpt_tooltip_plus"> +</span></a></div>
|
729 |
<div class="rpt_feature rpt_feature_0-9">
|
778 |
} else {
|
779 |
$mysticky_class_id_selector = 'custom';
|
780 |
}
|
781 |
+
|
782 |
+
$mystickyClass = '.navbar';
|
783 |
+
$template_name = get_template();
|
784 |
+
switch( $template_name ){
|
785 |
+
case 'ashe':
|
786 |
+
$mysticky_class_id_selector = 'custom';
|
787 |
+
$mystickyClass = '#main-nav';
|
788 |
+
break;
|
789 |
+
case 'astra':
|
790 |
+
case 'hello-elementor':
|
791 |
+
case 'sydney':
|
792 |
+
case 'twentysixteen':
|
793 |
+
$mysticky_class_id_selector = 'custom';
|
794 |
+
$mystickyClass = 'header.site-header';
|
795 |
+
break;
|
796 |
+
case 'generatepress':
|
797 |
+
$mysticky_class_id_selector = 'custom';
|
798 |
+
$mystickyClass = 'nav.main-navigation';
|
799 |
+
break;
|
800 |
+
case 'transportex':
|
801 |
+
$mysticky_class_id_selector = 'custom';
|
802 |
+
$mystickyClass = '.transportex-menu-full';
|
803 |
+
break;
|
804 |
+
case 'hestia':
|
805 |
+
case 'neve':
|
806 |
+
$mysticky_class_id_selector = 'custom';
|
807 |
+
$mystickyClass = 'header.header';
|
808 |
+
break;
|
809 |
+
case 'mesmerize':
|
810 |
+
$mysticky_class_id_selector = 'custom';
|
811 |
+
$mystickyClass = '.navigation-bar';
|
812 |
+
break;
|
813 |
+
case 'oceanwp':
|
814 |
+
$mysticky_class_id_selector = 'custom';
|
815 |
+
$mystickyClass = 'header#site-header';
|
816 |
+
break;
|
817 |
+
case 'shapely':
|
818 |
+
$mysticky_class_id_selector = 'custom';
|
819 |
+
$mystickyClass = '#site-navigation';
|
820 |
+
break;
|
821 |
+
case 'storefront':
|
822 |
+
$mysticky_class_id_selector = 'custom';
|
823 |
+
$mystickyClass = '.storefront-primary-navigation';
|
824 |
+
break;
|
825 |
+
case 'twentynineteen':
|
826 |
+
$mysticky_class_id_selector = 'custom';
|
827 |
+
$mystickyClass = '#site-navigation';
|
828 |
+
break;
|
829 |
+
case 'twentyseventeen':
|
830 |
+
$mysticky_class_id_selector = 'custom';
|
831 |
+
$mystickyClass = '.navigation-top';
|
832 |
+
break;
|
833 |
+
default:
|
834 |
+
break;
|
835 |
+
}
|
836 |
+
|
837 |
+
|
838 |
$default = array(
|
839 |
'mysticky_class_id_selector' => $mysticky_class_id_selector,
|
840 |
+
'mysticky_class_selector' => $mystickyClass,
|
841 |
'device_desktop' => 'on',
|
842 |
'device_mobile' => 'on',
|
843 |
'myfixed_zindex' => '99990',
|
927 |
echo $mysticky_options ['myfixed_cssstyle'];
|
928 |
}
|
929 |
echo '</style>';
|
930 |
+
$template_name = get_template();
|
931 |
+
?>
|
932 |
+
<style type="text/css">
|
933 |
+
<?php if( $template_name == 'hestia' ) { ?>
|
934 |
+
#mysticky-nav.wrapfixed {box-shadow: 0 1px 10px -6px #0000006b,0 1px 10px 0 #0000001f,0 4px 5px -2px #0000001a;}
|
935 |
+
#mysticky-nav.wrapfixed .navbar {position: relative;background-color: transparent;box-shadow: none;}
|
936 |
+
<?php } ?>
|
937 |
+
<?php if( $template_name == 'shapely' ) { ?>
|
938 |
+
#mysticky-nav.wrapfixed #site-navigation {position: relative;}
|
939 |
+
<?php } ?>
|
940 |
+
<?php if( $template_name == 'storefront' ) { ?>
|
941 |
+
#mysticky-nav.wrapfixed > .site-header {margin-bottom: 0;}
|
942 |
+
#mysticky-nav.wrapfixed > .storefront-primary-navigation {padding: 10px 0;}
|
943 |
+
<?php } ?>
|
944 |
+
<?php if( $template_name == 'transportex' ) { ?>
|
945 |
+
#mysticky-nav.wrapfixed > .transportex-menu-full {margin: 0 auto;}
|
946 |
+
.transportex-headwidget #mysticky-nav.wrapfixed .navbar-wp {top: 0;}
|
947 |
+
<?php } ?>
|
948 |
+
<?php if( $template_name == 'twentynineteen' ) { ?>
|
949 |
+
#mysticky-nav.wrapfixed {padding: 10px;}
|
950 |
+
<?php } ?>
|
951 |
+
<?php if( $template_name == 'twentysixteen' ) { ?>
|
952 |
+
#mysticky-nav.wrapfixed > .site-header {padding-top: 0;padding-bottom: 0;}
|
953 |
+
<?php } ?>
|
954 |
+
</style>
|
955 |
+
<?php
|
956 |
}
|
957 |
}
|
958 |
|
1042 |
$mystickyDisableLarge = isset($mysticky_options['myfixed_disable_large_screen']) ? $mysticky_options['myfixed_disable_large_screen'] : '0';
|
1043 |
|
1044 |
$mystickyClass = ( $mysticky_options['mysticky_class_id_selector'] != 'custom') ? '.menu-' . $mysticky_options['mysticky_class_id_selector'] .'-container' : $mysticky_options['mysticky_class_selector'];
|
1045 |
+
|
1046 |
+
if ( $mysticky_options['mysticky_class_id_selector'] != 'custom' ) {
|
1047 |
+
$template_name = get_template();
|
1048 |
+
switch( $template_name ){
|
1049 |
+
case 'ashe':
|
1050 |
+
$mystickyClass = '#main-nav';
|
1051 |
+
break;
|
1052 |
+
case 'astra':
|
1053 |
+
case 'hello-elementor':
|
1054 |
+
case 'sydney':
|
1055 |
+
case 'twentysixteen':
|
1056 |
+
$mystickyClass = 'header.site-header';
|
1057 |
+
break;
|
1058 |
+
case 'generatepress':
|
1059 |
+
$mystickyClass = 'nav.main-navigation';
|
1060 |
+
break;
|
1061 |
+
case 'transportex':
|
1062 |
+
$mystickyClass = '.transportex-menu-full';
|
1063 |
+
break;
|
1064 |
+
case 'hestia':
|
1065 |
+
case 'neve':
|
1066 |
+
$mystickyClass = 'header.header';
|
1067 |
+
break;
|
1068 |
+
case 'mesmerize':
|
1069 |
+
$mystickyClass = '.navigation-bar';
|
1070 |
+
break;
|
1071 |
+
case 'oceanwp':
|
1072 |
+
$mystickyClass = 'header#site-header';
|
1073 |
+
break;
|
1074 |
+
case 'shapely':
|
1075 |
+
$mystickyClass = '#site-navigation';
|
1076 |
+
break;
|
1077 |
+
case 'storefront':
|
1078 |
+
$mystickyClass = '.storefront-primary-navigation';
|
1079 |
+
break;
|
1080 |
+
case 'twentynineteen':
|
1081 |
+
$mystickyClass = '#site-navigation';
|
1082 |
+
break;
|
1083 |
+
case 'twentyseventeen':
|
1084 |
+
$mystickyClass = '.navigation-top';
|
1085 |
+
break;
|
1086 |
+
default:
|
1087 |
+
break;
|
1088 |
+
}
|
1089 |
+
}
|
1090 |
+
|
1091 |
|
1092 |
$mysticky_translation_array = array(
|
1093 |
'mystickyClass' => $mystickyClass,
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: tomeraharon, galdub, premio
|
|
3 |
Tags:menu, header, sticky menu, sticky header, floating menu, floating navigation menu, navigation menu, navigation, sticky navigation menu, welcome bar, hello bar, top bar, sticky bar, floating bar, notification bar
|
4 |
Requires at least: 3.5.1
|
5 |
Tested up to: 5.2
|
6 |
-
Stable tag: 2.2.
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
This sticky menu plugin will make your menu or header stick to the top of page, when scrolled down and up. Also create a beautiful Welcome bar with it.
|
@@ -52,7 +52,7 @@ My Sticky Menu is tested and compatible with Elementor website builder, Divi, WP
|
|
52 |
* Disable floating menu on Desktop/Mobile
|
53 |
* Disable floating menu on scroll down
|
54 |
* Add CSS style to the floating header
|
55 |
-
* Disable floating header on specific pages
|
56 |
|
57 |
But wait, there's more 😉
|
58 |
|
@@ -257,6 +257,8 @@ After installing the plugin, you’ll have the option to turn on the welcome bar
|
|
257 |
|
258 |
|
259 |
== Changelog ==
|
|
|
|
|
260 |
= 2.2.4 =
|
261 |
Smoother transition when the sticky menu disappears
|
262 |
= 2.2.3 =
|
3 |
Tags:menu, header, sticky menu, sticky header, floating menu, floating navigation menu, navigation menu, navigation, sticky navigation menu, welcome bar, hello bar, top bar, sticky bar, floating bar, notification bar
|
4 |
Requires at least: 3.5.1
|
5 |
Tested up to: 5.2
|
6 |
+
Stable tag: 2.2.5
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
This sticky menu plugin will make your menu or header stick to the top of page, when scrolled down and up. Also create a beautiful Welcome bar with it.
|
52 |
* Disable floating menu on Desktop/Mobile
|
53 |
* Disable floating menu on scroll down
|
54 |
* Add CSS style to the floating header
|
55 |
+
* Disable/enable floating header on specific pages
|
56 |
|
57 |
But wait, there's more 😉
|
58 |
|
257 |
|
258 |
|
259 |
== Changelog ==
|
260 |
+
= 2.2.5 =
|
261 |
+
myStickyelements now works out-of-the-box with the following themes (which means you don't need to find your menu's class, it should work right after installation): Twenty Nineteen, Twenty Seventeen, Hello Elementor, OceanWP, Astra, Storefront, Twenty Sixteen, Neve, Hestia, Sydney, Shapely, GeneratePress, Mesmerize, Ashe, and Total. We've also added Google Lighthouse compatibility
|
262 |
= 2.2.4 =
|
263 |
Smoother transition when the sticky menu disappears
|
264 |
= 2.2.3 =
|
welcome-bar.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
function mysticky_welcome_bar_backend() {
|
4 |
$nonce = wp_create_nonce('mysticky_option_welcomebar_update');
|
5 |
$nonce_reset = wp_create_nonce('mysticky_option_welcomebar_reset');
|
6 |
-
|
7 |
$welcomebar = get_option( 'mysticky_option_welcomebar' );
|
8 |
if ( $welcomebar == '' || empty($welcomebar)) {
|
9 |
$welcomebar = mysticky_welcomebar_pro_widget_default_fields();
|
10 |
}
|
11 |
-
|
12 |
$mysticky_welcomebar_showx_desktop = $mysticky_welcomebar_showx_mobile = '';
|
13 |
$mysticky_welcomebar_btn_desktop = $mysticky_welcomebar_btn_mobile = '';
|
14 |
$mysticky_welcomebar_display_desktop = $mysticky_welcomebar_display_mobile = '';
|
@@ -218,7 +218,7 @@ function mysticky_welcome_bar_backend() {
|
|
218 |
</label>
|
219 |
<label>
|
220 |
<input type="radio" name="mysticky_option_welcomebar[mysticky_welcomebar_trigger]" value="after_scroll" disabled /> <?php _e( 'After Scroll', 'myStickymenu' );?>
|
221 |
-
</label>
|
222 |
</div>
|
223 |
<div class="mysticky-welcomebar-setting-action mysticky-welcomebar-triggersec">
|
224 |
<div class="px-wrap">
|
@@ -238,37 +238,37 @@ function mysticky_welcome_bar_backend() {
|
|
238 |
</div>
|
239 |
</div>
|
240 |
<div class="mysticky-welcomebar-setting-content show-on-apper">
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
|
|
|
|
264 |
</div>
|
265 |
-
<div class="clear"></div>
|
266 |
</div>
|
267 |
</div>
|
|
|
268 |
</div>
|
269 |
</div>
|
270 |
-
<div class="mysticky-welcomebar-page-options mysticky-welcomebar-setting-content-right" id="mysticky-welcomebar-page-options"></div>
|
271 |
-
</div>
|
272 |
</div>
|
273 |
</div>
|
274 |
<div class="mysticky-welcomebar-setting-right">
|
@@ -290,13 +290,13 @@ function mysticky_welcome_bar_backend() {
|
|
290 |
</div>
|
291 |
</div>
|
292 |
</div>
|
293 |
-
<div class="mysticky-welcomebar-submit">
|
294 |
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save', 'mystickymenu');?>">
|
295 |
</div>
|
296 |
<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
|
297 |
<input type="hidden" name="active_tab_element" value="1">
|
298 |
<input type="hidden" id="save_welcome_bar" name="save_welcome_bar" value="">
|
299 |
-
|
300 |
</form>
|
301 |
<form class="mysticky-welcomebar-form-reset" method="post" action="#">
|
302 |
<div class="mysticky-welcomebar-submit">
|
@@ -342,7 +342,7 @@ function mysticky_welcome_bar_backend() {
|
|
342 |
font-family: inherit;
|
343 |
margin: 0;
|
344 |
padding: 0;
|
345 |
-
line-height: 1.2;
|
346 |
font-weight: 400;
|
347 |
}
|
348 |
.mysticky-welcomebar-fixed .mysticky-welcomebar-btn {
|
@@ -424,8 +424,8 @@ function mysticky_welcome_bar_backend() {
|
|
424 |
.mysticky-welcomebar-getbar:hover {
|
425 |
color: #000000 !important;
|
426 |
opacity: 0.5 !important;
|
427 |
-
}
|
428 |
-
|
429 |
@media only screen and (max-width: 1024px) {
|
430 |
.mysticky-welcomebar-fixed {
|
431 |
padding: 0 20px 0 10px;
|
@@ -438,7 +438,7 @@ function mysticky_welcome_bar_backend() {
|
|
438 |
}
|
439 |
}
|
440 |
</style>
|
441 |
-
|
442 |
<?php
|
443 |
}
|
444 |
|
@@ -472,7 +472,7 @@ function mysticky_welcomebar_pro_widget_default_fields() {
|
|
472 |
|
473 |
function mysticky_welcome_bar_frontend(){
|
474 |
$welcomebar = get_option( 'mysticky_option_welcomebar' );
|
475 |
-
|
476 |
if ( ( isset($welcomebar['mysticky_welcomebar_expirydate']) && $welcomebar['mysticky_welcomebar_expirydate'] !='' && strtotime( date('m/d/Y')) > strtotime($welcomebar['mysticky_welcomebar_expirydate']) ) || !isset($welcomebar['mysticky_welcomebar_enable'] ) ) {
|
477 |
return;
|
478 |
}
|
@@ -491,12 +491,12 @@ function mysticky_welcome_bar_frontend(){
|
|
491 |
if( isset($welcomebar['mysticky_welcomebar_btn_mobile']) ) {
|
492 |
$mysticky_welcomebar_btn_mobile = ' mysticky-welcomebar-btn-mobile';
|
493 |
}
|
494 |
-
|
495 |
$mysticky_welcomebar_display_desktop = ' mysticky-welcomebar-display-desktop';
|
496 |
$mysticky_welcomebar_display_mobile = ' mysticky-welcomebar-display-mobile';
|
497 |
-
|
498 |
$display_main_class = "mysticky-welcomebar-position-" . $welcomebar['mysticky_welcomebar_position'] . $mysticky_welcomebar_showx_desktop . $mysticky_welcomebar_showx_mobile . $mysticky_welcomebar_btn_desktop . $mysticky_welcomebar_btn_mobile . $mysticky_welcomebar_display_desktop . $mysticky_welcomebar_display_mobile;
|
499 |
-
|
500 |
if( isset($welcomebar['mysticky_welcomebar_actionselect']) ) {
|
501 |
if( $welcomebar['mysticky_welcomebar_actionselect'] == 'redirect_to_url' ) {
|
502 |
$mysticky_welcomebar_actionselect_url = esc_url( $welcomebar['mysticky_welcomebar_redirect'] );
|
@@ -511,7 +511,7 @@ function mysticky_welcome_bar_frontend(){
|
|
511 |
$welcomebar_enable_block = "bottom: -60px";
|
512 |
}
|
513 |
}
|
514 |
-
|
515 |
?>
|
516 |
<div class="mysticky-welcomebar-fixed <?php echo $display_main_class; ?>" style="<?php echo $welcomebar_enable_block; ?>" data-after-triger="after_a_few_seconds" data-triger-sec="0" data-position="<?php echo esc_attr($welcomebar['mysticky_welcomebar_position']);?>" data-height="<?php echo esc_attr($welcomebar['mysticky_welcomebar_height']);?>" data-rediect="<?php echo esc_attr($welcomebar['mysticky_welcomebar_actionselect']);?>">
|
517 |
<div class="mysticky-welcomebar-content">
|
@@ -521,24 +521,25 @@ function mysticky_welcome_bar_frontend(){
|
|
521 |
<a href="<?php echo $mysticky_welcomebar_actionselect_url; ?>" <?php if( isset($welcomebar['mysticky_welcomebar_redirect_newtab']) && $welcomebar['mysticky_welcomebar_actionselect'] == 'redirect_to_url' && $welcomebar['mysticky_welcomebar_redirect_newtab']== 1):?> target="_blank" <?php endif;?>><?php echo isset($welcomebar['mysticky_welcomebar_btn_text'])?$welcomebar['mysticky_welcomebar_btn_text']:"Got it!";?></a>
|
522 |
</div>
|
523 |
<a href="javascript:void(0)" class="mysticky-welcomebar-close">X</a>
|
524 |
-
<a href="https://premio.io/downloads/mystickymenu/?utm_source=credit&domain=<?php echo $_SERVER['HTTP_HOST']; ?>" class="mysticky-welcomebar-getbar" target="_blank"><?php _e( 'Get Bar', 'mystickymenu' );?></a>
|
525 |
</div>
|
526 |
-
<script>
|
527 |
-
|
528 |
jQuery(document).ready(function($){
|
|
|
529 |
if( jQuery( '.mysticky-welcomebar-fixed' ).data('position') == 'top' ) {
|
530 |
-
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '-
|
531 |
} else {
|
532 |
-
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '-
|
533 |
-
}
|
534 |
if ( sessionStorage.getItem("welcomebar_close") === null ){
|
535 |
-
|
536 |
var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
|
537 |
-
|
538 |
-
if ( after_trigger == 'after_a_few_seconds' ) {
|
539 |
if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) {
|
540 |
if ( $( window ).width() > 767 ) {
|
541 |
-
var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
|
542 |
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
|
543 |
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
|
544 |
setTimeout(function(){
|
@@ -548,13 +549,13 @@ function mysticky_welcome_bar_frontend(){
|
|
548 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
549 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
550 |
$( 'html' ).css( 'margin-bottom', '' );
|
551 |
-
$( 'html' ).attr( 'style', 'margin-top:
|
552 |
-
$( '#mysticky-nav' ).css( 'top', '
|
553 |
} else {
|
554 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
555 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
556 |
$( 'html' ).css( 'margin-top', '' );
|
557 |
-
$( 'html' ).attr( 'style', 'margin-bottom:
|
558 |
}
|
559 |
}, trigger_sec );
|
560 |
}
|
@@ -572,20 +573,21 @@ function mysticky_welcome_bar_frontend(){
|
|
572 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
573 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
574 |
$( 'html' ).css( 'margin-bottom', '' );
|
575 |
-
$( 'html' ).attr( 'style', 'margin-top:
|
576 |
-
$( '#mysticky-nav' ).css( 'top', '
|
577 |
} else {
|
578 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
579 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
580 |
$( 'html' ).css( 'margin-top', '' );
|
581 |
-
$( 'html' ).attr( 'style', 'margin-bottom:
|
582 |
}
|
583 |
}, trigger_sec );
|
584 |
}
|
585 |
}
|
586 |
}
|
|
|
587 |
}
|
588 |
-
$( window ).resize( function(){
|
589 |
if ( sessionStorage.getItem("welcomebar_close") === null ){
|
590 |
var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
|
591 |
if ( after_trigger == 'after_a_few_seconds' ) {
|
@@ -600,13 +602,13 @@ function mysticky_welcome_bar_frontend(){
|
|
600 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
601 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
602 |
$( 'html' ).css( 'margin-bottom', '' );
|
603 |
-
$( 'html' ).attr( 'style', 'margin-top:
|
604 |
-
$( '#mysticky-nav' ).css( 'top', '
|
605 |
} else {
|
606 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
607 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
608 |
$( 'html' ).css( 'margin-top', '' );
|
609 |
-
$( 'html' ).attr( 'style', 'margin-bottom:
|
610 |
}
|
611 |
}, trigger_sec );
|
612 |
}
|
@@ -618,30 +620,31 @@ function mysticky_welcome_bar_frontend(){
|
|
618 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
619 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
620 |
$( 'html' ).css( 'margin-bottom', '' );
|
621 |
-
$( 'html' ).attr( 'style', 'margin-top:
|
622 |
-
$( '#mysticky-nav' ).css( 'top', '
|
623 |
} else {
|
624 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
625 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
626 |
$( 'html' ).css( 'margin-top', '' );
|
627 |
-
$( 'html' ).attr( 'style', 'margin-bottom:
|
628 |
}
|
629 |
}, trigger_sec );
|
630 |
}
|
631 |
}
|
632 |
}
|
633 |
-
|
|
|
634 |
} );
|
635 |
-
|
636 |
-
jQuery(window).scroll(function(){
|
637 |
if ( sessionStorage.getItem("welcomebar_close") === null ){
|
638 |
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
|
639 |
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
|
640 |
-
if ( welcombar_position == 'top' ) {
|
641 |
-
$( '#mysticky-nav' ).css( 'top',
|
642 |
}
|
643 |
-
if ( after_trigger === 'after_scroll' ) {
|
644 |
-
var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height());
|
645 |
var after_scroll_val = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec');
|
646 |
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
|
647 |
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
|
@@ -653,13 +656,13 @@ function mysticky_welcome_bar_frontend(){
|
|
653 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
654 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
655 |
$( 'html' ).css( 'margin-bottom', '' );
|
656 |
-
$( 'html' ).attr( 'style', 'margin-top:
|
657 |
-
$( '#mysticky-nav' ).css( 'top', '
|
658 |
} else {
|
659 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
660 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
661 |
$( 'html' ).css( 'margin-top', '' );
|
662 |
-
$( 'html' ).attr( 'style', 'margin-bottom:
|
663 |
}
|
664 |
}
|
665 |
}
|
@@ -670,36 +673,85 @@ function mysticky_welcome_bar_frontend(){
|
|
670 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
671 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
672 |
$( 'html' ).css( 'margin-bottom', '' );
|
673 |
-
$( 'html' ).attr( 'style', 'margin-top:
|
674 |
-
$( '#mysticky-nav' ).css( 'top', '
|
675 |
} else {
|
676 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
677 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
678 |
$( 'html' ).css( 'margin-top', '' );
|
679 |
-
$( 'html' ).attr( 'style', 'margin-bottom:
|
680 |
}
|
681 |
}
|
682 |
}
|
683 |
}
|
684 |
}
|
|
|
685 |
}
|
686 |
-
|
687 |
});
|
688 |
-
jQuery( '.mysticky-welcomebar-close, .mysticky-welcomebar-btn a' ).on( 'click', function(){
|
689 |
-
|
|
|
690 |
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
|
691 |
-
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
|
692 |
jQuery( '.mysticky-welcomebar-fixed' ).slideUp( 'slow' );
|
693 |
if ( welcombar_position == 'top' ) {
|
694 |
-
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '-' +
|
695 |
} else {
|
696 |
-
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '-' +
|
697 |
}
|
698 |
jQuery( 'html' ).css( 'margin-top', '' );
|
699 |
jQuery( 'html' ).css( 'margin-bottom', '' );
|
700 |
$( '#mysticky-nav' ).css( 'top', '0px' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
701 |
} );
|
702 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
703 |
</script>
|
704 |
<style>
|
705 |
.mysticky-welcomebar-fixed {
|
@@ -827,8 +879,8 @@ function mysticky_welcome_bar_frontend(){
|
|
827 |
.mysticky-welcomebar-getbar:hover {
|
828 |
color: #000000 !important;
|
829 |
opacity: 0.5 !important;
|
830 |
-
}
|
831 |
-
@media only screen and (max-width: 767px) {
|
832 |
.mysticky-welcomebar-display-desktop.mysticky-welcomebar-position-top.mysticky-welcomebar-fixed {
|
833 |
top: -60px;
|
834 |
}
|
1 |
+
<?php
|
2 |
|
3 |
function mysticky_welcome_bar_backend() {
|
4 |
$nonce = wp_create_nonce('mysticky_option_welcomebar_update');
|
5 |
$nonce_reset = wp_create_nonce('mysticky_option_welcomebar_reset');
|
6 |
+
|
7 |
$welcomebar = get_option( 'mysticky_option_welcomebar' );
|
8 |
if ( $welcomebar == '' || empty($welcomebar)) {
|
9 |
$welcomebar = mysticky_welcomebar_pro_widget_default_fields();
|
10 |
}
|
11 |
+
|
12 |
$mysticky_welcomebar_showx_desktop = $mysticky_welcomebar_showx_mobile = '';
|
13 |
$mysticky_welcomebar_btn_desktop = $mysticky_welcomebar_btn_mobile = '';
|
14 |
$mysticky_welcomebar_display_desktop = $mysticky_welcomebar_display_mobile = '';
|
218 |
</label>
|
219 |
<label>
|
220 |
<input type="radio" name="mysticky_option_welcomebar[mysticky_welcomebar_trigger]" value="after_scroll" disabled /> <?php _e( 'After Scroll', 'myStickymenu' );?>
|
221 |
+
</label>
|
222 |
</div>
|
223 |
<div class="mysticky-welcomebar-setting-action mysticky-welcomebar-triggersec">
|
224 |
<div class="px-wrap">
|
238 |
</div>
|
239 |
</div>
|
240 |
<div class="mysticky-welcomebar-setting-content show-on-apper">
|
241 |
+
<label><?php _e('Page targeting', 'myStickymenu'); ?></label>
|
242 |
+
<div class="mysticky-welcomebar-setting-content-right">
|
243 |
+
<a href="javascript:void(0);" class="create-rule" id="create-rule"><?php esc_html_e( "Add Rule", "mystickyelements" );?></a>
|
244 |
+
</div>
|
245 |
+
<div class="mysticky-welcomebar-page-options-html" style="display: none">
|
246 |
+
<div class="mysticky-welcomebar-page-option">
|
247 |
+
<div class="url-content">
|
248 |
+
<div class="mysticky-welcomebar-url-select">
|
249 |
+
<select name="mysticky_option_welcomebar[page_settings][__count__][shown_on]" id="url_shown_on___count___option" disabled>
|
250 |
+
<option value="show_on"><?php esc_html_e("Show on", "mysticky" );?></option>
|
251 |
+
<option value="not_show_on"><?php esc_html_e("Don't show on", "mysticky" );?></option>
|
252 |
+
</select>
|
253 |
+
</div>
|
254 |
+
<div class="mysticky-welcomebar-url-option">
|
255 |
+
<select class="mysticky-welcomebar-url-options" name="mysticky_option_welcomebar[page_settings][__count__][option]" id="url_rules___count___option" disabled>
|
256 |
+
<option selected="selected" disabled value=""><?php esc_html_e("Select Rule", "mysticky" );?></option>
|
257 |
+
</select>
|
258 |
+
</div>
|
259 |
+
<div class="mysticky-welcomebar-url-box">
|
260 |
+
<span class='mysticky-welcomebar-url'><?php echo site_url("/"); ?></span>
|
261 |
+
</div>
|
262 |
+
<div class="mysticky-welcomebar-url-values">
|
263 |
+
<input type="text" value="" name="mysticky_option_welcomebar[page_settings][__count__][value]" id="url_rules___count___value" disabled />
|
264 |
+
</div>
|
265 |
+
<div class="clear"></div>
|
266 |
</div>
|
|
|
267 |
</div>
|
268 |
</div>
|
269 |
+
<div class="mysticky-welcomebar-page-options mysticky-welcomebar-setting-content-right" id="mysticky-welcomebar-page-options" style="display:none"></div>
|
270 |
</div>
|
271 |
</div>
|
|
|
|
|
272 |
</div>
|
273 |
</div>
|
274 |
<div class="mysticky-welcomebar-setting-right">
|
290 |
</div>
|
291 |
</div>
|
292 |
</div>
|
293 |
+
<div class="mysticky-welcomebar-submit">
|
294 |
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save', 'mystickymenu');?>">
|
295 |
</div>
|
296 |
<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
|
297 |
<input type="hidden" name="active_tab_element" value="1">
|
298 |
<input type="hidden" id="save_welcome_bar" name="save_welcome_bar" value="">
|
299 |
+
|
300 |
</form>
|
301 |
<form class="mysticky-welcomebar-form-reset" method="post" action="#">
|
302 |
<div class="mysticky-welcomebar-submit">
|
342 |
font-family: inherit;
|
343 |
margin: 0;
|
344 |
padding: 0;
|
345 |
+
line-height: 1.2;
|
346 |
font-weight: 400;
|
347 |
}
|
348 |
.mysticky-welcomebar-fixed .mysticky-welcomebar-btn {
|
424 |
.mysticky-welcomebar-getbar:hover {
|
425 |
color: #000000 !important;
|
426 |
opacity: 0.5 !important;
|
427 |
+
}
|
428 |
+
|
429 |
@media only screen and (max-width: 1024px) {
|
430 |
.mysticky-welcomebar-fixed {
|
431 |
padding: 0 20px 0 10px;
|
438 |
}
|
439 |
}
|
440 |
</style>
|
441 |
+
|
442 |
<?php
|
443 |
}
|
444 |
|
472 |
|
473 |
function mysticky_welcome_bar_frontend(){
|
474 |
$welcomebar = get_option( 'mysticky_option_welcomebar' );
|
475 |
+
|
476 |
if ( ( isset($welcomebar['mysticky_welcomebar_expirydate']) && $welcomebar['mysticky_welcomebar_expirydate'] !='' && strtotime( date('m/d/Y')) > strtotime($welcomebar['mysticky_welcomebar_expirydate']) ) || !isset($welcomebar['mysticky_welcomebar_enable'] ) ) {
|
477 |
return;
|
478 |
}
|
491 |
if( isset($welcomebar['mysticky_welcomebar_btn_mobile']) ) {
|
492 |
$mysticky_welcomebar_btn_mobile = ' mysticky-welcomebar-btn-mobile';
|
493 |
}
|
494 |
+
|
495 |
$mysticky_welcomebar_display_desktop = ' mysticky-welcomebar-display-desktop';
|
496 |
$mysticky_welcomebar_display_mobile = ' mysticky-welcomebar-display-mobile';
|
497 |
+
|
498 |
$display_main_class = "mysticky-welcomebar-position-" . $welcomebar['mysticky_welcomebar_position'] . $mysticky_welcomebar_showx_desktop . $mysticky_welcomebar_showx_mobile . $mysticky_welcomebar_btn_desktop . $mysticky_welcomebar_btn_mobile . $mysticky_welcomebar_display_desktop . $mysticky_welcomebar_display_mobile;
|
499 |
+
|
500 |
if( isset($welcomebar['mysticky_welcomebar_actionselect']) ) {
|
501 |
if( $welcomebar['mysticky_welcomebar_actionselect'] == 'redirect_to_url' ) {
|
502 |
$mysticky_welcomebar_actionselect_url = esc_url( $welcomebar['mysticky_welcomebar_redirect'] );
|
511 |
$welcomebar_enable_block = "bottom: -60px";
|
512 |
}
|
513 |
}
|
514 |
+
|
515 |
?>
|
516 |
<div class="mysticky-welcomebar-fixed <?php echo $display_main_class; ?>" style="<?php echo $welcomebar_enable_block; ?>" data-after-triger="after_a_few_seconds" data-triger-sec="0" data-position="<?php echo esc_attr($welcomebar['mysticky_welcomebar_position']);?>" data-height="<?php echo esc_attr($welcomebar['mysticky_welcomebar_height']);?>" data-rediect="<?php echo esc_attr($welcomebar['mysticky_welcomebar_actionselect']);?>">
|
517 |
<div class="mysticky-welcomebar-content">
|
521 |
<a href="<?php echo $mysticky_welcomebar_actionselect_url; ?>" <?php if( isset($welcomebar['mysticky_welcomebar_redirect_newtab']) && $welcomebar['mysticky_welcomebar_actionselect'] == 'redirect_to_url' && $welcomebar['mysticky_welcomebar_redirect_newtab']== 1):?> target="_blank" <?php endif;?>><?php echo isset($welcomebar['mysticky_welcomebar_btn_text'])?$welcomebar['mysticky_welcomebar_btn_text']:"Got it!";?></a>
|
522 |
</div>
|
523 |
<a href="javascript:void(0)" class="mysticky-welcomebar-close">X</a>
|
524 |
+
<a href="https://premio.io/downloads/mystickymenu/?utm_source=credit&domain=<?php echo $_SERVER['HTTP_HOST']; ?>" class="mysticky-welcomebar-getbar" target="_blank" rel="noopener"><?php _e( 'Get Bar', 'mystickymenu' );?></a>
|
525 |
</div>
|
526 |
+
<script>
|
527 |
+
|
528 |
jQuery(document).ready(function($){
|
529 |
+
var mysticky_welcomebar_height = jQuery( '.mysticky-welcomebar-fixed' ).innerHeight();
|
530 |
if( jQuery( '.mysticky-welcomebar-fixed' ).data('position') == 'top' ) {
|
531 |
+
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '-' + mysticky_welcomebar_height + 'px' );
|
532 |
} else {
|
533 |
+
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '-' + mysticky_welcomebar_height + 'px' );
|
534 |
+
}
|
535 |
if ( sessionStorage.getItem("welcomebar_close") === null ){
|
536 |
+
|
537 |
var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
|
538 |
+
|
539 |
+
if ( after_trigger == 'after_a_few_seconds' ) {
|
540 |
if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) {
|
541 |
if ( $( window ).width() > 767 ) {
|
542 |
+
var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
|
543 |
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
|
544 |
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
|
545 |
setTimeout(function(){
|
549 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
550 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
551 |
$( 'html' ).css( 'margin-bottom', '' );
|
552 |
+
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
|
553 |
+
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
|
554 |
} else {
|
555 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
556 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
557 |
$( 'html' ).css( 'margin-top', '' );
|
558 |
+
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
|
559 |
}
|
560 |
}, trigger_sec );
|
561 |
}
|
573 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
574 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
575 |
$( 'html' ).css( 'margin-bottom', '' );
|
576 |
+
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
|
577 |
+
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
|
578 |
} else {
|
579 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
580 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
581 |
$( 'html' ).css( 'margin-top', '' );
|
582 |
+
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
|
583 |
}
|
584 |
}, trigger_sec );
|
585 |
}
|
586 |
}
|
587 |
}
|
588 |
+
mystickyelements_present();
|
589 |
}
|
590 |
+
$( window ).resize( function(){
|
591 |
if ( sessionStorage.getItem("welcomebar_close") === null ){
|
592 |
var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
|
593 |
if ( after_trigger == 'after_a_few_seconds' ) {
|
602 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
603 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
604 |
$( 'html' ).css( 'margin-bottom', '' );
|
605 |
+
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
|
606 |
+
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
|
607 |
} else {
|
608 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
609 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
610 |
$( 'html' ).css( 'margin-top', '' );
|
611 |
+
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
|
612 |
}
|
613 |
}, trigger_sec );
|
614 |
}
|
620 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
621 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
622 |
$( 'html' ).css( 'margin-bottom', '' );
|
623 |
+
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
|
624 |
+
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
|
625 |
} else {
|
626 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
627 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
628 |
$( 'html' ).css( 'margin-top', '' );
|
629 |
+
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
|
630 |
}
|
631 |
}, trigger_sec );
|
632 |
}
|
633 |
}
|
634 |
}
|
635 |
+
mystickyelements_present();
|
636 |
+
}
|
637 |
} );
|
638 |
+
|
639 |
+
jQuery(window).scroll(function(){
|
640 |
if ( sessionStorage.getItem("welcomebar_close") === null ){
|
641 |
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
|
642 |
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
|
643 |
+
if ( welcombar_position == 'top' ) {
|
644 |
+
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
|
645 |
}
|
646 |
+
if ( after_trigger === 'after_scroll' ) {
|
647 |
+
var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height());
|
648 |
var after_scroll_val = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec');
|
649 |
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
|
650 |
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
|
656 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
657 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
658 |
$( 'html' ).css( 'margin-bottom', '' );
|
659 |
+
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
|
660 |
+
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
|
661 |
} else {
|
662 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
663 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
664 |
$( 'html' ).css( 'margin-top', '' );
|
665 |
+
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
|
666 |
}
|
667 |
}
|
668 |
}
|
673 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
|
674 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
675 |
$( 'html' ).css( 'margin-bottom', '' );
|
676 |
+
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
|
677 |
+
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
|
678 |
} else {
|
679 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
|
680 |
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
|
681 |
$( 'html' ).css( 'margin-top', '' );
|
682 |
+
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
|
683 |
}
|
684 |
}
|
685 |
}
|
686 |
}
|
687 |
}
|
688 |
+
mystickyelements_present();
|
689 |
}
|
690 |
+
|
691 |
});
|
692 |
+
jQuery( '.mysticky-welcomebar-close, .mysticky-welcomebar-btn a' ).on( 'click', function(){
|
693 |
+
console.log("mysticky_welcomebar_height = " + mysticky_welcomebar_height);
|
694 |
+
sessionStorage.setItem('welcomebar_close', 'close');
|
695 |
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
|
696 |
+
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
|
697 |
jQuery( '.mysticky-welcomebar-fixed' ).slideUp( 'slow' );
|
698 |
if ( welcombar_position == 'top' ) {
|
699 |
+
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '-' + mysticky_welcomebar_height + 'px' );
|
700 |
} else {
|
701 |
+
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '-' + mysticky_welcomebar_height + 'px' );
|
702 |
}
|
703 |
jQuery( 'html' ).css( 'margin-top', '' );
|
704 |
jQuery( 'html' ).css( 'margin-bottom', '' );
|
705 |
$( '#mysticky-nav' ).css( 'top', '0px' );
|
706 |
+
/*if mystickyelements show*/
|
707 |
+
var mystickyelements_show = $( '.mystickyelements-fixed' ).length;
|
708 |
+
if( mystickyelements_show && $( window ).width() <= 1024 && $( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) && welcombar_position == 'top' ) {
|
709 |
+
var mystickyelements_height = $( '.mystickyelements-fixed' ).height();
|
710 |
+
$( '.mystickyelements-fixed' ).css( 'top', '' );
|
711 |
+
$( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_height + 'px !important' );
|
712 |
+
}
|
713 |
} );
|
714 |
});
|
715 |
+
function mystickyelements_present() {
|
716 |
+
var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
|
717 |
+
var mystickyelements_show = jQuery( '.mystickyelements-fixed' ).length;
|
718 |
+
if( mystickyelements_show ) {
|
719 |
+
var welcombar_position = jQuery( '.mysticky-welcomebar-fixed' ).data('position');
|
720 |
+
var welcombar_height = jQuery( '.mysticky-welcomebar-fixed' ).innerHeight();
|
721 |
+
var mystickyelements_height = jQuery( '.mystickyelements-fixed' ).height();
|
722 |
+
var mystickyelements_total_height = welcombar_height + mystickyelements_height;
|
723 |
+
if ( jQuery( window ).width() <= 1024 && jQuery( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) ) {
|
724 |
+
if ( after_trigger == 'after_a_few_seconds' ) {
|
725 |
+
if ( jQuery( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
|
726 |
+
var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
|
727 |
+
setTimeout(function(){
|
728 |
+
if ( welcombar_position == 'top' ) {
|
729 |
+
jQuery( '.mystickyelements-fixed' ).css( 'top', welcombar_height );
|
730 |
+
jQuery( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' );
|
731 |
+
} else {
|
732 |
+
jQuery( '.mystickyelements-fixed' ).css( 'top', '' );
|
733 |
+
jQuery( 'html' ).attr( 'style', 'margin-bottom: ' + welcombar_height + 'px !important' );
|
734 |
+
}
|
735 |
+
}, trigger_sec );
|
736 |
+
}
|
737 |
+
} else if ( after_trigger === 'after_scroll' ) {
|
738 |
+
var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height());
|
739 |
+
var after_scroll_val = $( '.mysticky-welcomebar-fixed' ).data('triger-sec');
|
740 |
+
if( scroll > after_scroll_val ) {
|
741 |
+
if ( jQuery( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
|
742 |
+
if ( welcombar_position == 'top' ) {
|
743 |
+
jQuery( '.mystickyelements-fixed' ).css( 'top', welcombar_height );
|
744 |
+
jQuery( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' );
|
745 |
+
} else {
|
746 |
+
jQuery( '.mystickyelements-fixed' ).css( 'top', '' );
|
747 |
+
jQuery( 'html' ).attr( 'style', 'margin-bottom: ' + welcombar_height + 'px !important' );
|
748 |
+
}
|
749 |
+
}
|
750 |
+
}
|
751 |
+
}
|
752 |
+
}
|
753 |
+
}
|
754 |
+
}
|
755 |
</script>
|
756 |
<style>
|
757 |
.mysticky-welcomebar-fixed {
|
879 |
.mysticky-welcomebar-getbar:hover {
|
880 |
color: #000000 !important;
|
881 |
opacity: 0.5 !important;
|
882 |
+
}
|
883 |
+
@media only screen and (max-width: 767px) {
|
884 |
.mysticky-welcomebar-display-desktop.mysticky-welcomebar-position-top.mysticky-welcomebar-fixed {
|
885 |
top: -60px;
|
886 |
}
|