Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #16511

    Hi!,

    In an AJAXfied portfolio page, I’m looking to preload the first portfolio item.

    I believe I should modify loop-portfolio.php and add some code after line #140 { echo $slider->display($forceSmall) } to fire an AJAX call with the proper post_id !

    I don’t know what would be the exact code to be added :) or if this is the right approach !

    Appreciate your help.

    #91775

    Hi,

    Open up js/avia.js and replace:

    jQuery(document).ready(function(){

    with:

    jQuery(document).ready(function(){
    setTimeout(function () {
    jQuery('.ajax_portfolio_container .portfolio-title:first a').trigger('click');
    }, 600);

    You can increase/decrease the delay value (600ms atm).

    #91776

    Hi,

    Working great except for one side effect, the page is scrolling down to focus the portfolio item being loaded.

    This portfolio page is last element of my home page (via Template Builder), so scrolling away the heading elements (logo, menu, slider ..etc.) is not really nice or efficient for visitors.

    #91777

    Hi,

    Find this code on avia.js

    scroll_top: function()
    {
    var target_offset = container.offset().top - 100,
    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);
    }
    }

    Replace it with

    scroll_top: function()
    {
    var target_offset = container.offset().top - 100,
    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);
    }
    }

    Remove browser history then reload the page.

    Regards,

    Ismael

    #91778

    Hi,

    Worked like a charm .. awesome support :)

    Thanks a lot.

    #91779

    Hey,

    Glad it worked.

    Regards,

    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Pre-load a Portfolio item in a Portfolio page’ is closed to new replies.