Tagged: anchor, expand, link, smooth scroll
-
AuthorPosts
-
June 7, 2016 at 11:16 am #643955
Hi,
Thanks for great theme!! Well done!
I’m working on a site where I would love to be able to click on a link for map on the bottom of site “Se kart”, and that a map will appear on click. That we get the same smooth scroll effect like the other anchor links on the site (look menu to test).
https://www.dropbox.com/s/pvt00p4qxb3yjhq/1.jpg?dl=0
https://www.dropbox.com/s/h0qmdqvtmth7r85/2.jpg?dl=0
Look link to site in private content.
Is that possible?
Thanks a lot, kindly regards, MathildeJune 8, 2016 at 5:57 am #644539Hey mofix,
Thank you for using Enfold.
Create a bookmark or anchor links. More info here: http://kriesi.at/documentation/enfold/add-anchors-to-your-page-for-single-page-navigation/
Best regards,
IsmaelJune 8, 2016 at 11:03 am #644693Hi Ismael,
Thanks, It worked when I put a text section with the anchor link before each color section. Now the title shows! :-)
But is there any opportunity to have a hidden section that shows on click on anchor link?
Kindly regards, MathildeJune 8, 2016 at 4:16 pm #644931Hi again Ismael,
I have been adding the latest code from this: https://kriesi.at/support/topic/hidding-color-section/?login_error and now the color section is hidden, and I have a botton link that opens it!! :-) But the only thing now is that when it opens I have to scroll down to the map, the smooth scroll to the anchor link doesn’t seem to work properly.
If you scroll down to the bottom of the page and click the link “Se kart” you will see that the map is opened when you scroll a bit down.
http://dev.restaurantrenaa.no/matbaren/
Kindly regards, MathildeJune 9, 2016 at 11:36 am #645377Hi,
Please replace the code in the functions.php file with this:
function add_custom_cs(){ ?> <script> (function($){ var section = $('#kart'), button = $('.kart'); section.clone().insertAfter(section).addClass('cloned'); $('.cloned').empty(); $('.cloned').height('0'); $('.cloned').css('min-height', '1px'); $('.cloned').attr('id', 'kartpos'); section.not('.cloned').css({ 'visibility' : 'hidden', 'position' : 'absolute' }); button.click(function(e) { if(section.css('visibility') == 'hidden') { section.not('.cloned').css({ 'visibility' : 'visible', 'position' : 'relative' }); var pos = $('#kartpos').offset(); setTimeout( function() { $('body').scrollTop( pos ); }, 300); } else { section.not('.cloned').css({ 'visibility' : 'hidden', 'position' : 'absolute' }); } }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_cs');
Adjust the selector in this line:
var section = $('#test'), button = $('.test');
Best regards,
IsmaelJune 9, 2016 at 12:13 pm #645393Hi Ismael,
Thanks so much!
Still not working.
Screen of functions.php here: https://www.dropbox.com/s/ye2nf60vlm6ymza/functions.jpg?dl=0
Screen of button here: https://www.dropbox.com/s/w1g9sejbn7czjdk/button.jpg?dl=0
Screen of color section here: https://www.dropbox.com/s/ont9g6m5wi78a6r/colorsection.jpg?dl=0
Kindly regards, MathildeJune 12, 2016 at 4:22 am #646771Hi,
Hmm. Please post the login details here so that we can test it. Did you remove the previous code?
Best regards,
IsmaelJune 12, 2016 at 1:21 pm #646902Hi,
Thanks, Thought I removed the previous code yes.
Here’s the login (private content):June 16, 2016 at 3:04 am #648920Hi,
You forgot to add the anchor or href attribute (#kart) in the button.
Best regards,
IsmaelJune 16, 2016 at 3:57 pm #649286Hi Ismael,
Thank you so much. I had http://dev.restaurantrenaa.no/matbaren/#kart on the button, and I see you had changed it to #kart. And it worked. But then I tried to edit the map section to make the map widescreen in the color section. And now it’s not working, and I can’t fint out why. I’m so sorry for taking your time on this.
Thanks for removing the scroller that made the site jumping on the parallax!!!
Kindly regards, MathildeJune 20, 2016 at 3:48 am #650558Hi,
And it worked. But then I tried to edit the map section to make the map widescreen in the color section.
I’m sorry but what did you do? Did you transfer the site? I can see an error which is not there before:
LayerSlider error:
It seems like the URL of the image or background image “Kokkehendermat.jpg” is pointing to a wrong location and it cannot be loaded. Please check the URLs of all your images used in the slider
Best regards,
IsmaelJune 20, 2016 at 9:52 am #650703Hi Ismael,
I don’t know what happened. Suddenly I couldn’t add new images, the site was just loading and loading. So I tried to delete images to see if that helped, and also reinstall Enfold etc. But I can’t get it work properly. It’s like the site have crashed some how.I think maybe I have to reinstall WordPress also.I have installed Enfold and tried to build up the site on root in this domain dev.restaurantrenaa.no (since there will be 4 sites under 1 domain (I buy 4 Enfold themes). So now I was going to try to fix the map section again, but was a bit worry to try. But it was be so great if it would work out, also in widescreen.
Would it also be possible to have the link change to: Open map (When map is hidden) – Close map (When map is open)?
Thanks so much!!!!
Kindly regards, MathildeSee private section for login
June 22, 2016 at 3:56 am #651840Hi,
We modified the code a bit. Please remove browser cache or hard refresh the page.
Best regards,
IsmaelJune 22, 2016 at 10:53 am #652006Hi ismael,
Fantastic!! Thank you so much!! You are amazing!! I made the map widescreen, so now it really looks great!Is it possible to have the link changed after open. Like Open map and close map / an icon that points up and down? “Se kart” / “Lukk kart”.
I promise I will use this function on many Enfold themes :-)))
Kindly regards, MathildeJune 22, 2016 at 3:12 pm #652137Hi again, just a little bug. When I touch the map to make it bigger og to drag it, it closes.
Kindly regards, MathildeJune 24, 2016 at 6:36 am #652860Hi,
Hi again, just a little bug. When I touch the map to make it bigger og to drag it, it closes.
There’s custom css class attribute called “kart” in the color section. We removed that.
Best regards,
IsmaelJune 24, 2016 at 2:15 pm #653023Hi Ismael,
Thanks a lot!!!!
KIndly regards, MathildeJune 24, 2016 at 6:51 pm #653144Hi again Ismael,
Is the open and close map link something I must buy to get fixed? Does it take much more programming to do? This is a function I think many will be very happy for in the Enfold community :-). So just to have that little extra that the link changes on click would be awesome! I see others have that as well.
Kindly regards, MathildeJune 29, 2016 at 3:40 am #654553Hi,
Is the open and close map link something I must buy to get fixed? Does it take much more programming to do? This is a function I think many will be very happy for in the Enfold community :-). So just to have that little extra that the link changes on click would be awesome! I see others have that as well.
Yes, that will require modifications that we won’t be able to provide here. Please hire a freelance developer or contact codeable. http://kriesi.at/contact
Best regards,
IsmaelJune 29, 2016 at 11:56 am #654757Hi Ismael, Okay, thanks!
Best regards, MathildeJuly 2, 2016 at 4:56 am #655980 -
AuthorPosts
- The topic ‘Anchor link to color section that's hidden and will open up / expand on click’ is closed to new replies.