• Resolved nickyg81

    (@nickyg81)


    feed=”https://yourdomain.com/01.mp3

    the guide tells me you can activate the click on the NON sticky reader with this JS code:
    jQuery('[data-albums="75"]').find('li:nth-child(2) .audio-track').trigger( "click" );

    i can’t figure out how to insert the JS into my wp site.

    I would like to create a series of posts with a button for each post, this button on click will send the link in a php variable which will replace the external link in the do_shortcode.

    How can I activate this thing?the guide is totally absent in this regard.

    2. can I remove the play next previous track controls?
    3. How can I activate a trigger on the custom play / pause?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author sonaar

    (@sonaar)

    Hi there,

    there are multiple ways to add javascript to your website.
    You can add it in HTML with:

    <script>
    jQuery('[data-albums="75"]').find('li:nth-child(2) .audio-track').trigger( "click" );
    </script>

    or use a third party plugin such as https://wordpress.org/plugins/insert-script-in-headers-and-footers/

    I think you will need to hire a WordPress developer to customize it to your needs.

    2: how will people be able to listen to the audio if you remove the play control?
    you can remove any assets using display:none; css on elements you want to hide.

    3: you can do it with Javascript as the example provided above or in this article https://sonaar.ticksy.com/article/15282

    Thread Starter nickyg81

    (@nickyg81)

    ok I insert this code in the footer.
    But I wanted to understand what the trigger command is like
    on a buttom, image, link element. This is not written.
    The event to be assigned to the click of the link to load the mp3 in the shortcode (do_shortcode)

    [Button click] ——-> trigger audio url in shortcode feed = “audio.mp3″

    in footer…
    <script> jQuery(‘[data-albums=”75”]’).find(‘li:nth-child(2) .audio-track’).trigger( “click” ); </script>

    Plugin Author sonaar

    (@sonaar)

    Sorry I dont correctly understand your question/formulation of the question.

    Please check with your WordPress developer on how to implement js call into your theme, as this can be very different from different themes and plugins.

    Thread Starter nickyg81

    (@nickyg81)

    i am the developer of my theme and i am asking you how i should implement js calls for your plugin.

    How should I insert the link with js calls to your player?
    all by implementing shortcode with links (feed = “https://www.domain.com/01.mp3)

    Why not put detailed examples in the guide?
    You have just written the script code to insert and stop!

    jQuery (‘[data-albums = “75”]’). find (‘li: nth-child (2) .audio-track’). trigger (“click”);

    Plugin Author sonaar

    (@sonaar)

    Well, js can be implemented in different ways depending on your setup and what you are trying to achieve…

    You can add jQuery/JS on your custom button with something like

    $('#button1').click(function(){ 
       $('[data-albums="75"]').find('li:nth-child(2) .audio-track').trigger( "click" );
    });

    This is just an example and I have not tested this code.

    Please note that implementing your own JS code is beyond the scope of our free support.Thanks for your understanding.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘shortcode and javascript trigger click’ is closed to new replies.