Home / Forums / Basel support forum / VISUAL COMPOSER ROW SCROLL
Home › Forums › Basel support forum › VISUAL COMPOSER ROW SCROLL
VISUAL COMPOSER ROW SCROLL
- This topic has 21 replies, 5 voices, and was last updated 7 years, 11 months ago by
Artem Temos.
-
AuthorPosts
-
January 31, 2017 at 7:08 pm #9458
empapelarteParticipantHello!
I´d like to make an internal link between a button and a row (in the same page). I gave the row an ID (#scroll). How can I do for linking the button and the row with a smooth scroll?
Thanks a lot!
January 31, 2017 at 7:38 pm #9460Hello,
There is no such option in our theme. But you can achieve it easily using this simple JS snippet. Add it to the Custom JS and replace selectors classes for button and for the row
jQuery(".buttonCustomClass").click(function() { jQuery('html, body').animate({ scrollTop: jQuery("#scroll").offset().top - 50 }, 2000); });Regards
January 31, 2017 at 8:04 pm #9461
empapelarteParticipantThanks for your answer.
I don´t understand how can I do this: “Add it to the Custom JS and replace selectors classes for button and for the row”. Can you send me a screen or can you explain it for a dummy like me, hehe…thanks a lot!
January 31, 2017 at 8:15 pm #9463You can add this code to the Custom JS area in Theme Settings. In the code you will find two selectors:
1. for the button link
jQuery(".buttonCustomClass")2. and for the row with ID
jQuery("#scroll")So just create a button with class
buttonCustomClassand row with idscrolland use this codejQuery(".buttonCustomClass").click(function() { jQuery('html, body').animate({ scrollTop: jQuery("#scroll").offset().top - 50 }, 2000); });Regards
January 31, 2017 at 8:32 pm #9467
empapelarteParticipantSo, I´ve just pasted this code in Global Custom JS (theme settings). Then I go to the page that I created with Visual Composer. I assign to the row ID: #scroll. Next point, how can I create with Visual Composer a buttonCustomClass?
Sorry…
January 31, 2017 at 9:21 pm #9473Then, you just need to add some button or link. For example you can use our them “Button” element and set extra class to be “buttonCustomClass”
February 1, 2017 at 6:14 pm #9509
empapelarteParticipantI tried but it´s not working. I attach a picture where you can see the code, the button configuration and the row configuration. What´s wrong?
February 1, 2017 at 6:15 pm #9510
empapelarteParticipantSorry, I didn´t send you the picture. Here it is…
February 1, 2017 at 6:16 pm #9511
empapelarteParticipantThis is the picture… 😉
Attachments:
You must be logged in to view attached files.February 1, 2017 at 7:36 pm #9515You need to remove
#before ID in the row settings.December 1, 2017 at 5:54 pm #26618
codecomParticipantIs there any way to make all anchor links with # have a smooth scroll? or all links with certain class. instead of putting a separate snippet for every row ID?
I tried to do according many tutorials online including this one but nothing works.
Please help.
Thank you!December 1, 2017 at 10:47 pm #26653Hi,
What exactly code did you add from the article? Could you please provide us a link where we can see this added to your website?
Regards
July 15, 2018 at 9:40 am #67595
GiulioParticipantHi there, I’d like also to me to add a smooth scroll on some buttons or icons, but that code do not work on Basel. Could you help me please?
July 15, 2018 at 12:43 pm #67605
Elise NoromitMemberHello,
Our theme does not have such options. You will need to customize.
Best Regards
July 15, 2018 at 12:44 pm #67606
GiulioParticipantI know that. You was really available on december. What happen? 😀 I tried the code that you suggested, but it doesn’t work.
July 15, 2018 at 6:55 pm #67649Could you please send us a link where you placed the code? Send us all the screenshots with steps you performed according to our instructions. We will check what you did wrong.
July 16, 2018 at 2:39 pm #67839
GiulioParticipantThe button is on the 2 arrows that points down. The scroll is working (as default), but not the smooth feature. Thank you!
July 16, 2018 at 2:41 pm #67840Try to replace JS code with this one
jQuery(".buttonCustomClass").click(function(e) { e.preventDefault(); jQuery('html, body').animate({ scrollTop: jQuery("#scroll").offset().top - 50 }, 2000); });July 16, 2018 at 2:44 pm #67841
GiulioParticipantUnfortunately it not work.
July 16, 2018 at 2:45 pm #67842It works well for us https://gyazo.com/2749301564a4b920655796a0369ae617
July 16, 2018 at 2:48 pm #67843
GiulioParticipantI can’t see any smooth scroll on Safari and also on Chrome.
July 16, 2018 at 6:16 pm #67900Strange, but it works for us. We don’t have other solutions for this.
-
AuthorPosts
Tagged: scroll, visual composer
- You must be logged in to create new topics. Login / Register