Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="truncate">
    <h1><span style="font-size:14px;">Chaussures orthop&eacute;diques&nbsp;: la s&eacute;lection de Podexpert</span></h1>

<p>&nbsp;</p>

<p>En tant que professionnels de sant&eacute;, nous avons choisis pour vous le meilleur&nbsp;des <strong>chaussures orthop&eacute;diques</strong> pour vos pieds sensibles. Ces chaussures et chaussons seront les compl&eacute;ments id&eacute;aux &agrave; vos orth&egrave;ses plantaires.</p>

<p>C&#39;est pour cette raison que tous les mod&egrave;les de cette gamme de <strong>chaussure orthop&eacute;dique</strong>&nbsp;pr&eacute;sente dans cette cat&eacute;gorie poss&egrave;dent des semelles amovibles que vous pourrez ais&eacute;ment remplacer par vos semelles orthop&eacute;diques.</p>

<p>Ces <strong>chaussures m&eacute;dicales</strong> sont &eacute;tudi&eacute;es pour des pieds atypiques et acceptant mal les chaussures standards.</p>

<p>Retrouvez dans cette cat&eacute;gorie les&nbsp;<a class="lien_editeur" href="https://www.podexpert.com/chaussures-hallux-valgus-xsl-436_464.html">chaussures hallux valgus</a>&nbsp;et les&nbsp;<a class="lien_editeur" href="https://www.podexpert.com/chaussures-pied-large-xsl-436_466.html">chaussures pied large</a>.</p>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                $(document).ready(function() {
  (function() {
    var showChar = 300;
    var ellipsestext = "...";
    $(".truncate").each(function() {
      var content = $(this).html();
      if (content.length > showChar) {
        var cut = content.indexOf("</p>", showChar); /* détermine la première fermeture de paragraphe à partir de showChar caractères */
        var c = content.substring(0, cut+3); /* c = contenu avant la coupure */
        var h = content.substring(cut+4); /* h = contenu après la coupure */
        var html =
          c +
          '<span class="moreellipses">' +
          '<div class="truncate-text" style="display:block">' +
          ellipsestext +
          '<p style=text-align:center><a href="" class="moreless more">Voir plus...</a></p></div></span></div><div class="truncate-text" style="display:none">' +
          h +
          '<p style=text-align:center><a href="" class="moreless less">Voir moins...</a></p></span></div>';
 
        $(this).html(html);
      }
    });
 
    $(".moreless").click(function() {
      var thisEl = $(this);
      var cT = thisEl.closest(".truncate-text");
      var tX = ".truncate-text";
 
      if (thisEl.hasClass("less")) {
        cT.prev(tX).toggle();
        cT.slideToggle();
      } else {
        cT.toggle();
        cT.next(tX).fadeToggle();
      }
      return false;
    });
    /* end iffe */
  })();
 
  /* end ready */
});
              
            
!
999px

Console