-
AuthorPosts
-
November 5, 2015 at 2:51 pm #530803
Hi guys,
I’ve added the following code in a codeblock just above a Ajax portfolio grid:
var triggerportfolio = setTimeout(function(){jQuery('.grid-links-ajax a:first').trigger('click');},800);
That’s working fine, the first items is folding out… but because I use this code on the homepage, I don’t want the browser to take me there…
I’ve tried adding:
setTimeout(function (){ window.scrollTo(0, 0); }, 1600);
And played a bit around with the timeouts… unfortunately this is not really working. Sometimes it doesn’t take me back to the top at all. Jumping back and forth from the unfolded item to the top isn’t ideal either.
I very much would like to keep the autoscroll on different pages in the website, so completely removing the scroll would not be the best solution…
So my question is: Is it possible to open the first Ajax portfolio item but not scrolling to this item that has been folded out, preferably by adding some Javascript to a Codeblock ?
Thanks in advance and best regards,
Bas
November 9, 2015 at 11:51 am #532491Hey Bas!
unfortunately your question is out of our support scope as written in our support policy. It would require a huge amount of time and customization to achieve a behavior like this and if you can’t do it yourself, you would need to hire a freelance developer for this job.
Feel free to make a feature request for Kriesi here: kriesi.at/support/enfold-feature-requests/
Best regards,
AndyP.s.: Check out the new Enfold version, with lots of new features and bugfixes.
November 9, 2015 at 12:06 pm #532497Hi Andy,
That is too bad… Is it possible to tell me where to find the function that sets / calculates the scrolling position when clicking on a portfolio item to open the AJAX preview?
Regards,
Bas
November 10, 2015 at 4:23 am #533018Hi!
You can find it in the js > shortcodes.js file. Look for the “Avia AJAX Portfolio” section and this function:
scroll_top: function() { setTimeout(function() { var target_offset = target_wrap.offset().top - 175, window_offset = win.scrollTop(); if(window_offset > target_offset || target_offset - window_offset > 100 ) { $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target_offset }, options.timing, options.easing); } },10); },
Regards,
IsmaelJuly 14, 2016 at 2:54 am #660634I modified the offset here (around line #1491) to compensate for a revised header height in case anyone else is looking for a solution to that.
Thanks, IsmaelJuly 14, 2016 at 4:47 am #660646Hi,
Thank you for sharing your tip :)
Let us know if you have any questions.
Best regards,
Vinay -
AuthorPosts
- You must be logged in to reply to this topic.