Tagged: x
-
AuthorPosts
-
April 2, 2016 at 2:02 am #863540
Hello
I have created a slider with links that target IDs on the same page. I all works however I would like it to ‘smooth scroll’ to the Id (right now it just jumps to it).
I have tried:
jQuery(document).ready(function($) {
var $body = $(‘body’);
var $bodyHeight = $body.outerHeight();
var $adminbarHeight = $(‘#wpadminbar’).outerHeight();
var $navbarHeight = $(‘.x-navbar’).outerHeight();$(‘.page-id-52 .rev_slider a[href^=”#”]’).click(function(e) {
e.preventDefault();
var $contentBand = $(this).attr(‘href’);
$(‘html, body’).animate({
scrollTop: $($contentBand).offset().top – $adminbarHeight – $navbarHeight + 1
}, 850, ‘easeInOutExpo’);
});
});but not luck.
Any Idea how i can get this to work?
Thanks
Justin
April 2, 2016 at 8:19 pm #864187Hello Justin,
Thanks for writing in! Please do edit you slider and remove the action of your button. And you need to change the code of you button. So that the JS script will work out, you must have your button code like this:
<a href="#website" class="x-btn">Click Here <i class="fa-icon-chevron-right"></i></a>
Please let us know how it goes.
April 2, 2016 at 10:57 pm #864288Thank you very much, it now works with the button.
I would like for images to be able to link to the ID as well, is there a way to do this?
I have tried putting #website in an ‘action’ simple link but that doesn’t work.
Thanks in advance.
Justin
April 3, 2016 at 6:48 am #864594Hi there,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
April 19, 2016 at 12:47 am #889325This reply has been marked as private.April 19, 2016 at 12:55 am #889332I just figured out how to make it work for images, all i needed to do was change the link type to “a Tag Link” under the layers “actions”.
Thanks
April 19, 2016 at 6:57 am #889861Glad you’ve figured it out. 🙂
-
AuthorPosts