Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
- <meta name="format-detection" content="telephone=no">
- <title>Strider | Home</title>
- <link type="text/css" rel="stylesheet" href="css/style.css">
- <style>
- .body-copy{position: relative; width: 100%; height: auto;}
- .body-copy-two{position: absolute; visibility: hidden; height: 0; padding: 0; margin: 0;}
- </style>
- </head>
- <body>
- <h2 class="white body-copy">Technology that changes financial services to better people’s lives.</h2>
- <h2 class="body-copy-two"></h2>
- <script type="text/javascript">
- function wordWrap() {
- $(".body-copy").each(function(){
- var bdy = $(this);
- var body2 = bdy.parent().find(".body-copy-two");
- var text = $(bdy).text();
- var html = $(bdy).html();
- var bWidth = $(bdy).width();
- var words = text.split(" ");
- var span = "";
- var word = "";
- var allSpans = "";
- var lastWord = "";
- $(words).each(function(i, w) {
- if (lastWord != "") {
- w = lastWord + " "+ w ;
- lastWord = "";
- };
- word = w + " ";
- span = span + word;
- body2.append(word);
- if (body2.width() >= bWidth) {
- var wLen = word.length;
- span = span.slice(0, -wLen);
- lastWord = w + " ";
- allSpans = allSpans + "<span>" + $.trim(span) + "</span>";
- body2.html("");
- span = "";
- word = "";
- }
- });
- var lastSpan = "<span>" + body2.text() + "</span>";
- $(bdy).html(allSpans + lastSpan);
- })
- }
- wordWrap();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement