Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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

    #532491

    Hey 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,
    Andy

    P.s.: Check out the new Enfold version, with lots of new features and bugfixes.

    #532497

    Hi 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

    #533018

    Hi!

    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,
    Ismael

    #660634

    I 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, Ismael

    #660646

    Hi,

    Thank you for sharing your tip :)

    Let us know if you have any questions.

    Best regards,
    Vinay

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.