• Resolved kentinada

    (@kentinada)


    I want to add this small routine with this plugin but I’m not sure where to go. Can someone help?

    jQuery( “h2.entry-title” ).each( function() {
    var panelId = jQuery( this ).html().toLowerCase().replace(/\s+/g, “-“);
    jQuery( this ).wrapInner(function() {
    return “<span style=’padding-top:96px;’ id='” + panelId + “‘></span>”;
    })
    });

Viewing 1 replies (of 1 total)
  • Plugin Author SilkyPress

    (@diana_burduja)

    Hi,

    you can click on the “Add Custom JS” and paste your code there.

    Note that you need to wrap your code in:

    jQuery(document).ready(function( $ ){
    // your code
    });

    This is necessary when using the jQuery library, as you do.

    Here is the final code that you need to paste:


    jQuery(document).ready(function( $ ){
    jQuery( 'h2.entry-title' ).each( function() {
    var panelId = jQuery( this ).html().toLowerCase().replace(/\s+/g, "-");
    jQuery( this ).wrapInner(function() {
    return "<span style='padding-top:96px;' id='" + panelId + "'></span>";
    })
    });
    });

    Here you’ll find a screenshot with how it’s supposed to look like.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding jQuery module’ is closed to new replies.