Download raw (4.8 KB)
<!-- *- J A V A S C R I P T - --> <script type="text/javascript" src="https://lesscss.googlecode.com/files/less-1.3.0.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript" src="https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael-min.js"></script> <script type="text/javascript"> // INSÈRE UN CARACTÈRE UNICODE APRÈS <DD> (function($) { $.fn.postDD=function() { return this.each(function(){ $(this).after("<span>BLA</span>"); }); }; })(jQuery); // INSÈRE DES <WBR> ENTRE CHAQUE LETTRE (function($) { $.fn.bainesify=function() { return this.each(function(){ text = $(this).text().split(""); html = text.join("<wbr>"); console.log(text + html); $(this).html(html); }); }; })(jQuery); // TITRAGE -> DUPLIQUE L'ÉLÉMENT POUR LE PLACER EN-DESSOUS, CHANGER LE CLONE EN CSS (function($) { $.fn.titrage=function() { return this.each(function(){ $(this).wrapInner('<span />'); span = $("span", $(this)); span.clone().css({'position': 'absolute',}).insertBefore(span); }); }; })(jQuery); // FAIT COULER UN CONTENU DANS UN FLUX (function($) { $.fn.flowText=function() { return this.each(function(){ id = $(this).attr("id"); $("section#grille-" +id + " div.texte").css("-webkit-flow-from", "Text-" + id); $("div.content", this).css("-webkit-flow-into", "Text-" + id); $("section#grille-" + id + " div.image").css("-webkit-flow-from", "Image-" + id); $("div.image-cmjn", $(this)).css("-webkit-flow-into", "Image-" + id); $("section#grille-" + id + " div.bible").css("-webkit-flow-from", "Bible-" + id); $("dl.bible", $(this)).css("-webkit-flow-into", "Bible-" + id); }); }; })(jQuery); // CADRES LOSANGES (function($) { $.fn.cadre=function() { return this.each(function(){ w = $(this).width(); h = $(this).height(); t = $(this).offset().top; l = $(this).offset().left; $(this).clone().css({'position': 'absolute', "top": t, "left": l, "width": h, "height":w, "border": "3px solid black", "-webkit- transform":"rotateY(10deg)"}).text("").insertBefore($(this)); }); }; })(jQuery); $(document).ready(function(){ // TITRAGES //$("h2").titrage(); //$("h3").cadre(); // FAKE PAGES doc_height = $("body").height(); page_height = $("#fakepage").height(); //page_height = 22; nb_page = Math.ceil(doc_height/page_height); //gutter = parseInt($("#fakepage").css("top")); // = 1cm for (i = 0; i <= nb_page; i++){ $("#fakepage").clone().css({'outline': '1px solid white', 'outline-offset': '-1cm', 'display': 'block'}).attr("id","fakepage-p"+i).insertBefore($("#fakepage")); // TABLE DES MATIÈRES $("ul#toc").append("<li> <a>") $("ul#toc li:last-child a").attr("href", "#fakepage-p" + i).html("page" + i); } // AJOUTE UN UNICODE APRÈS <DD> $("dd").postDD(); // BAINESIFY //$("div.if p").bainesify(); // TEST SVG RAPHAELJS //hauteur = $("#moutons").offset().top; //console.log(hauteur); // Creates canvas 320 × 200 at 10, 50 //var paper = Raphael(10, hauteur, 320, 200); // Creates circle at x = 50, y = 40, with radius 10 //var circle = paper.circle(50, 40, 10); // Sets the fill attribute of the circle to red (#f00) //circle.attr("fill", "#f00"); // Sets the stroke attribute of the circle to white //circle.attr("stroke", "#fff"); }); </script> * </body> </html>