What's New
Viewing 11 posts - 1 through 11 (of 11 total)
Viewing 11 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic.
Hello,
I know that “Advanced sticky buy button module” it’s not compatible with my request, but I was inspired by it.
Let me explain: I’ve got an ecommerce but I offer also services that are illustrated in specific cms pages.
An example: https://www.igealasanitaria.it/it/pagine/tecnico-audioprotesista
I simply need a sticky link button (linked to contact page) that I can apply only for specific cms pages. It should appears when you scroll down.
Can you suggest me a module that works like this?
Or is it possible to customize “Advanced sticky buy button module” to have this funcionallity too?
Or should a customized module be developed?
Waiting for a response.
Best regards
1. Put this code to the custom css code field in the Theme editor module.
#sticky_button{position:fixed;width:100px;margin:0 auto;bottom:0;left:50%;display:none;z-index:9999;}
.cms-id-1 #sticky_button.showout,.cms-id-2 #sticky_button.showout{display:block;}
Replace 1,2 with your cms ids.
2. Put this code the Custom js code field.
$(document).ready(function(){
$('#st_header').waypoint(function(direction) {
if (direction == 'down'){
$('#sticky_button').addClass('showout');
}else if (direction == 'up'){
$('#sticky_button').removeClass('showout');
}
},{offset: -200});
});
3. Put this code the tracking code field.
<a href="#" class="btn btn-default" id="sticky_button">Contact us</a>
Hello,
thanks for your kindness and disponibility.
The code works only if the cms page is the first I open. But if I refresh the cms page or I surf around the website and then I go to the cms page, it doesn’t appear.
I have to delete the browser cache and then works again.
Waiting for reply.
Best regards
Oh, you probably enabled the Sticky header option.
Use this js code instead.
$(document).ready(function(){
$('#center_column').waypoint(function(direction) {
if (direction == 'down'){
$('#sticky_button').addClass('showout');
}else if (direction == 'up'){
$('#sticky_button').removeClass('showout');
}
},{offset: 0});
});
Hello,
yes, sticky header option was enabled. I use the code you have sent to me.
I know that in the mobile view the button was hidden by the sticky header menu, but this is not the problem I exposed to you: it works if it’s the fist time I open the cms page, but if I refresh the cms page or I surf around the website and then I go to the cms page, it doesn’t appear.
I’ve noticed that I have this problem with Google Chrome version 77.0.3865.120 and Mozilla Firefox version 69.0.3.
Instead it works perfectly with Internet Explorer version 11.0.9600.19507.
In Google Chrome the console gives me this error:
Uncaught ReferenceError: $ is not defined
at customer1.js?6906:1
And Mozilla Firefox the console gives me this error:
ReferenceError: $ is not definedcustomer1.js:1:1
<anonymous> https://www.igealasanitaria.it/modules/stthemeeditor/views/js/customer1.js?3278:1
You can see by yourself from this page: https://www.igealasanitaria.it/it/pagine/tecnico-audioprotesista
Waiting for reply.
Best regards
That code works fine on my side, try using this instead.
jQuery(document).ready(function($){
$('#center_column').waypoint(function(direction) {
if (direction == 'down'){
$('#sticky_button').addClass('showout');
}else if (direction == 'up'){
$('#sticky_button').removeClass('showout');
}
},{offset: 0});
});
You must be logged in to reply to this topic.