Plugin Directory

Changeset 2192748


Ignore:
Timestamp:
11/14/2019 12:34:11 PM (6 years ago)
Author:
man_ketan
Message:

jQuery issue fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • km-showhide/trunk/km-showhide.php

    r2191814 r2192748  
    55Description: This simple plugin allows you to toggle your content inside shortcode. Example usage: <code>[km_showhide]Hidden content goes in here.[/km_showhide]</code>
    66Version: 1.01
    7 Author: LKM
     7Author: KM
    88Author URI:
    99Text Domain: km_showhide
    1010License: GPL2
    1111*/
    12 
    13 
    14 
    15 ### Function: Short Code For Inserting Press Release Into Post
    16 
    17 
    18 
    19 wp_enqueue_script( 'ajax-jquery', plugin_dir_url( __FILE__ ) .'assets/js/jquery.min.js', '', '3.4.1', false );
    20 
    2112
    2213
     
    4334   
    4435    <script type="text/javascript">
    45         $( document ).ready( function () {
    46             $( '.read-more-content' ).addClass( 'hide' )
    47             $( '.read-more-show, .read-more-hide' ).removeClass( 'hide' )
     36        jQuery( document ).ready( function () {
     37            jQuery( '.read-more-content' ).addClass( 'hide' )
     38            jQuery( '.read-more-show, .read-more-hide' ).removeClass( 'hide' )
    4839
    4940            // Set up the toggle effect:
    50             $( '.read-more-show' ).on( 'click', function ( e ) {
    51                 $( this ).next( '.read-more-content' ).removeClass( 'hide' );
    52                 $( this ).addClass( 'hide' );
     41            jQuery( '.read-more-show' ).on( 'click', function ( e ) {
     42                jQuery( this ).next( '.read-more-content' ).removeClass( 'hide' );
     43                jQuery( this ).addClass( 'hide' );
    5344                e.preventDefault();
    5445            } );
    5546
    5647           
    57             $( '.read-more-hide' ).on( 'click', function ( e ) {
    58                 var p = $( this ).parent( '.read-more-content' );
     48            jQuery( '.read-more-hide' ).on( 'click', function ( e ) {
     49                var p = jQuery( this ).parent( '.read-more-content' );
    5950                p.addClass( 'hide' );
    6051                p.prev( '.read-more-show' ).removeClass( 'hide' ); // Hide only the preceding "Read More"
Note: See TracChangeset for help on using the changeset viewer.