Changeset 2192748
- Timestamp:
- 11/14/2019 12:34:11 PM (6 years ago)
- File:
-
- 1 edited
-
km-showhide/trunk/km-showhide.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
km-showhide/trunk/km-showhide.php
r2191814 r2192748 5 5 Description: This simple plugin allows you to toggle your content inside shortcode. Example usage: <code>[km_showhide]Hidden content goes in here.[/km_showhide]</code> 6 6 Version: 1.01 7 Author: LKM7 Author: KM 8 8 Author URI: 9 9 Text Domain: km_showhide 10 10 License: GPL2 11 11 */ 12 13 14 15 ### Function: Short Code For Inserting Press Release Into Post16 17 18 19 wp_enqueue_script( 'ajax-jquery', plugin_dir_url( __FILE__ ) .'assets/js/jquery.min.js', '', '3.4.1', false );20 21 12 22 13 … … 43 34 44 35 <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' ) 48 39 49 40 // 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' ); 53 44 e.preventDefault(); 54 45 } ); 55 46 56 47 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' ); 59 50 p.addClass( 'hide' ); 60 51 p.prev( '.read-more-show' ).removeClass( 'hide' ); // Hide only the preceding "Read More"
Note: See TracChangeset
for help on using the changeset viewer.