1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
| <!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8"/>
<meta name="Author" content="Daniel Hagnoul" />
<title>Page type</title>
<style>
body {
background-color:#dcdcdc;
color:#000000;
font-family:sans-serif;
font-size:medium;
font-style:normal;
font-weight:normal;
line-height:normal;
letter-spacing:normal;
}
h1,h2,h3,h4,h5 {
font-family:serif;
}
div,p,h1,h2,h3,h4,h5,h6,ul,ol,dl,form,table,img {
margin:0px;
padding:0px;
}
p {
padding:6px;
}
ul,ol,dl {
list-style:none;
padding-left:6px;
padding-top:6px;
}
li {
padding-bottom:6px;
}
div#conteneur {
width:95%;
margin:12px auto;
padding:6px;
background-color:#FFFFFF;
color:#000000;
border:1px solid #666666;
font-size:0.8em;
}
</style>
<script charset="CP-1252" src="../lib/jquery-1.4.1.min.js"></script>
<script>
$(function(){
/*
* plugin effect typewiter
*
* modifié par Daniel Hagnoul
*
* le 28 janvier 2010
*/
var boolStop = false;
$.fn.typewriter = function(opts){
var opt = opts || { 'delay': 50 };
var typeone = function(self, text, content){
if ((!boolStop) && (text.length > 0)){
var next = text.match(/(\s*(<[^>]*>)?)*(&.*?;|.?)/)[0];
text = text.substr(next.length);
$(self).html(content + next);
setTimeout(function(){
typeone(self, text, content+next);
}, opt['delay']);
} else {
return;
}
};
return this.each(function(){
$(this).height($(this).height());
$(this).width($(this).width());
/*
* $(this).text() au lieu de $(this).html()
*/
typeone(this, $(this).text(), '');
});
};
$("a").click(function(){
/*
* Il faut arrêter l'effet
*/
boolStop = true;
var page = $(this).attr("href");
/*
* il est nécessaire d'attendre un peu
* avant de relancer l'effet
*/
setTimeout(function(){
$.ajax({
url: page,
cache: false,
success:function(html){
$("#centre").html(html);
/*
* il faut relancer l'effet
*/
boolStop = false;
$(".typewriter").typewriter({'delay':80});
}
});
}, 500);
return false;
});
/*
* Pour voir l'effet à l'ouverture de la page.
*/
$(".typewriter").typewriter();
});
</script>
</head>
<body>
<div id="conteneur">
<div id="bloc_website">
<ul class="topnav">
<li>
<a href="blabla.html">Accueil</a>
</li>
</ul>
<div id="centre" class="typewriter">
<p>
Vestibulum ac nisl sit amet odio lobortis pellentesque. Quisque eu nisl. In ipsum metus, congue in, porta non, luctus ac, dolor. Ut suscipit, metus id blandit scelerisque, dolor nunc varius velit, sit amet feugiat magna neque ut lorem. Ut ut lacus. Curabitur eget magna iaculis tellus pulvinar sagittis. Maecenas eget urna. Nunc scelerisque, justo ultricies luctus consectetur, enim ante aliquam urna, sed ullamcorper quam orci nec arcu. Sed volutpat ligula quis elit. Donec vitae neque vel ipsum ultricies accumsan. Aenean imperdiet tincidunt augue. Morbi elementum metus a dui. Nunc non turpis. Maecenas vel odio non justo bibendum varius. Morbi tincidunt orci et purus. Duis mattis ullamcorper odio.
</p>
</div>
</div>
</div>
</body>
</html> |