-
AuthorPosts
-
August 8, 2014 at 12:01 am #80346
Todd B
ParticipantAwesome theme. This is my second purchase and I will be purchasing many others…
Here’s the development site I am working on: http://wholesale2.smseafood.com/
I have searched the forum and found things close but haven’t landed on it yet. What I want to do should be fairly simple and from what I have read ready, it involves custom javascript.
I am using revolution slider and the “Enable Scroll Bottom Anchor” in the page settings, however, I’d like the link to take the visitor further down the page so they land in the middle of the content band 2 (on desktop anyway, i know it won’t work exactly that way on tablets and mobile) so they see the text with a little of the images from content bands 1 and 3. I added an anchor id in the text of the second text area (in Content band 2) but don’t know how to put the anchor link into the slider. Can you give me the steps to doing that?
I know I can adjust where i put the anchor id, I just need to know how to link to it.
Thanks a bunch!
August 8, 2014 at 6:39 am #80479Christopher
ModeratorHi Todd,
Would you please add the code below into Customizer -> Custom -> JSjQuery('.x-slider-revolution-container.below .x-slider-scroll-bottom').click(function(e) { e.preventDefault(); e.stopPropagation(); jQuery('html, body').animate({ scrollTop: jQuery('#x-content-band-2').offset().top }, 850, 'easeInOutExpo'); });
Thank you.
August 8, 2014 at 9:46 am #80643Todd B
ParticipantThat doesn’t quite do it. It goes down to the right place but then bounces back up to the original spot. I realized on entering the javascript that i had another javascript snippet that I tried from one of the posts. I have removed that and that may have made the difference.
Please check again and let me know if you have a new snippet.
Thanks.
August 8, 2014 at 9:51 am #80650Cousett
MemberWould 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 / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
August 8, 2014 at 12:18 pm #80758Todd B
ParticipantThis reply has been marked as private.August 8, 2014 at 2:26 pm #80896Zeshan
MemberHi Todd,
Thank you for writing in!
Please remove the older jQuery code and try using the following:
jQuery(document).ready(function($) { $('.x-slider-revolution-container.below .x-slider-scroll-bottom').click(function(e) { e.preventDefault(); var $contentBand = $(this).attr('href'); $('html, body').animate({ scrollTop: $("#x-content-band-2").offset().top-250 }, 850, 'easeInOutExpo'); }); });
Hope this helps. 🙂
Thank you.
August 8, 2014 at 10:14 pm #81098Todd B
ParticipantThat works! Thanks.
August 9, 2014 at 12:00 am #81130Zeshan
MemberYou’re welcome Todd 🙂
March 2, 2015 at 12:27 pm #218581cosmoplan
ParticipantHi,
where i can put this jQuery code in?
I dont found customizer –> Custom –> JSThanks in advance
March 2, 2015 at 4:27 pm #218759Friech
ModeratorHi there,
Navigate to Appearance > Customize on the Customizer under the Custom panel you would see a JavaScript box.
If it does not there, please provide your URL and login credentials in private reply.
Cheers!
March 18, 2015 at 3:23 pm #230461Todd B
ParticipantI started this post. However, with the latest update, this script no longer works. Can you take a look and give me new javascript to perform the action requested in the first post? Thanks!
March 18, 2015 at 5:20 pm #230564Rad
ModeratorHi Todd,
Please update your script to this 🙂
jQuery(document).ready(function($) { $('.x-slider-container.below .x-slider-scroll-bottom').click(function(e) { e.preventDefault(); var $contentBand = $(this).attr('href'); $('html, body').animate({ scrollTop: $("#x-content-band-2").offset().top-250 }, 850, 'easeInOutExpo'); }); });
Cheers!
March 20, 2015 at 5:14 pm #232091Todd B
ParticipantThank you so much. Your support is awesome.
March 21, 2015 at 8:26 am #232373Thai
ModeratorYou’re always welcome.
February 8, 2016 at 12:15 pm #785831derrick
ParticipantHello! I’m trying to do something similar- I have a fixed navigation, and when the scroll button is clicked the section goes up under the navigation. I’m hoping to offset where the button scrolls to by about 90px.
Also, here is some script that I already have in the custom JavaScript window of the theme.
jQuery(function($){ $(window).scroll(function(){ if( $(this).scrollTop() == 0 ) { $('.x-navbar-fixed-top').removeClass('x-navbar-fixed-top'); } }) }); /*Smooth Scrolling*/ $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^//,'') == this.pathname.replace(/^//,'') || location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } });
And then here is what I tried to add to the bottom of this just to see if it did anything for me, but I didn’t have any luck with it doing anything different. I was hoping I could just change the “250” in the code below to “90” to get it to offset where I need it, but obviously I don’t know what I’m doing, haha. Thanks for your help.
jQuery(document).ready(function($) { $('.x-slider-container.below .x-slider-scroll-bottom').click(function(e) { e.preventDefault(); var $contentBand = $(this).attr('href'); $('html, body').animate({ scrollTop: $("#x-content-band-2").offset().top-250 }, 850, 'easeInOutExpo'); }); });
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-80346 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>