/**VLOŽIT DO FUNCTIONS***/ function alena_rysava_scripts() { // Načtěte soubor scripts.js wp_enqueue_script('alena-rysava-scripts', get_stylesheet_directory_uri() . '/scripts.js', array('jquery'), null, true); } add_action('wp_enqueue_scripts', 'alena_rysava_scripts'); /**VLOŽIT JQUERY - DO CHILDKY VLOŽIT NOVÝ SOUBOR scripts.js***/ <script> jQuery(document).ready(function() { var text_expand_text = "Rozbalit recenzi"; var text_collapse_text = "Zavřít recenzi"; var text_expand_icon = "3"; var text_collapse_icon = "2"; jQuery(".pa-toggle-text").each(function() { jQuery(this).append('<div class="pa-text-expand-button"><span class="pa-text-collapse-button">' + text_expand_text + ' <span class="pa-text-toggle-icon">' + text_expand_icon + '</span></span></div>'); jQuery(this).find(".pa-text-collapse-button").on("click", function() { jQuery(this).parent().siblings(".et_pb_text_inner").toggleClass("pa-text-toggle-expanded"); if (jQuery(this).parent().siblings(".et_pb_text_inner").hasClass("pa-text-toggle-expanded")) { jQuery(this).html(text_collapse_text + "<span class='pa-text-toggle-icon'>" + text_collapse_icon + "</span>"); } else { jQuery(this).html(text_expand_text + "<span class='pa-text-toggle-icon'>" + text_expand_icon + "</span>"); } }); }); }); </script> /**DO TEXTU VLOŽIT CSS TŘÍDU pa-toggle-text***/ /*collpse and set the height of the toggle text*/ .pa-toggle-text .et_pb_text_inner { max-height: 150px; transition: max-height 0.3s ease-out; overflow: hidden; } /*add gradient to the collapsed text*/ .pa-toggle-text .et_pb_text_inner:after { content: ""; display: inline-block; position: absolute; pointer-events: none; height: 100px; width: 100%; left: 0; right: 0; bottom: 0; background-image: linear-gradient(0deg, #fff 1%, transparent); } /*style the expand text link*/ .pa-toggle-text .pa-text-expand-button { padding: 10px 0; text-align: left; color: #e30074!important; } /*change the curor to a pointed when hovering over the expand text link*/ .pa-toggle-text .pa-text-expand-button span { cursor: pointer; } /*define the font family for the toggle icon*/ .pa-toggle-text .pa-text-expand-button .pa-text-toggle-icon { font-family: ETMODULES, "sans-serif"; } /*set the max height and transition of the expanded toggle*/ .pa-toggle-text .pa-text-toggle-expanded { max-height: 2000px; transition: max-height 3.3s ease-in; } /*hide the gradient when the toggle is expanded*/ .pa-toggle-text .pa-text-toggle-expanded.et_pb_text_inner:after { background: none; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter