Okay
  Public Ticket #1372431
Performance of shortcodes
Closed

Comments

  • Mark Syred started the conversation

    Hi there,

    Thanks for the support that has been provided in the past.

    Please could you have a look at something else for me? I take it that the attached screenshot does not display expected behaviour for the following shortcodes:

    • [radial_counter]
    • [progress_bar]
    • [accordion_item]

    These have been placed within a portfolio item that has been set to perform as an expander. If you'd like to see it for yourselves, visit the relevant domain, http://test-anthemengagement.wd9.uk/, click on Results in the nav, and then click on the HSS logo.

    I am right in thinking that these shortcodes, and any shortcode in fact, should work properly in a portfolio item expander? If not, why not?

    With kind regards,

    Mark

  •  1,798
    Support replied

    Hello Mark,

    The reason why these shortcodes don't work in the portfolio inline expander is because they require javascript execution in order to initialise.

    Javascript is executed when the page is loaded and the inline exapnde loads only the HTML code... 

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • Mark Syred replied

    Hi Support,

    Thanks for your reply.

    So, what's the solution then? I can't be the only one wanting to use shortcodes in a portfolio inline expander.

    With kind regards,

    Mark

  •  1,798
    Support replied

    Try adding the following code in /js/scripts.js on line 557

    // Radial Counters
    if( jQuery('.radial-counter').length > 0 ){
    jQuery(".knob").knob({
    width: 140,
    height: 140,
    fgColor: '#000',
    inputColor: '#fff',
    dynamicDraw: true,
    thickness: 0.05,
    tickColorizeValues: true,
    skin:'tron',
    readOnly:true,
    });
    jQuery(".knob").appear(function(e){
    var $this = jQuery(this);
    var myVal = $this.attr("data-gal");
        jQuery({value: 0}).animate({value: myVal}, {
       duration: 2000,
       easing: 'swing',
       step: function () {
       $this.val(Math.ceil(this.value)).trigger('change');
       }
       })
    });
    }


    //Progress bar animations
    jQuery('.progress-bar li').each(function(i){
    jQuery(this).appear(function(){
    var percent = jQuery(this).find('span').attr('data-width');
    var $endNum = parseInt(jQuery(this).find('span strong i').text());
    var $that = jQuery(this);
    jQuery(this).find('span').animate({
    'width' : percent + '%'
    },1600, function(){
    });
    jQuery(this).find('span strong').animate({
    'opacity' : 1
    },1400);
    jQuery(this).find('span strong i').countTo({
    from: 0,
    to: $endNum,
    speed: 1200,
    refreshInterval: 30,
    onComplete: function(){}
    });  
    if(percent == '100'){
    $that.find('span strong').addClass('full');
    }
    });
    });


    // Accordion   
    jQuery('dl.accordion dt').filter(':first-child').addClass('accordion-active');
    jQuery('dd.accordion-content').filter(':nth-child(n+3)').slideUp(1).addClass('hide');
    jQuery('dl.accordion').on('click', 'dt', function() {
    jQuery(this)
    .addClass('accordion-active')
    .next()
    .slideDown(200)
    .siblings('dd.accordion-content')
    .slideUp(200)
    .prev()
    .removeClass('accordion-active');

    });
    jQuery('dl.accordion').on('click', 'dt.accordion-active', function() {
    jQuery(this)
    .removeClass('accordion-active')
    .siblings('dd.accordion-content')
    .slideUp(200);
    });


    And then hard refresh the page (Ctrl+F5)

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy