Skip to content

Instantly share code, notes, and snippets.

@jonsan32
Last active December 19, 2015 16:09
Show Gist options
  • Save jonsan32/5982108 to your computer and use it in GitHub Desktop.
Save jonsan32/5982108 to your computer and use it in GitHub Desktop.
jQuery TextFX
<style type="text/css">
#effectTwo {
display: none;
}
#text-fx {
font-family: "Droid Sans", Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight:bold;
text-align:center;
line-height: 28px;
}
#text-fx > div {
position: relative;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
<script src="https://dl.dropboxusercontent.com/u/5739741/Images/inventions/textfx_source/source_files/js/jquery.easing.1.3.min.js" type="text/javascript"></script>
<script src="https://dl.dropboxusercontent.com/u/5739741/Images/inventions/textfx_source/source_files/js/cj-text-fx.min.js" type="text/javascript"></script>
<script type="text/javascript">
var isOn = 0, sets, fx, toAnimate = "#effect", settings = {
animation: 1,
animationType: "in",
backwards: false,
easing: "easeOutQuint",
speed: 1000,
sequenceDelay: 100,
startDelay: 0,
offsetX: 100,
offsetY: 50,
onComplete: fireThis,
restoreHTML: true
};
jQuery(document).ready(function() {
fx = jQuery("#effect");
jQuery.cjTextFx(settings);
jQuery.cjTextFx.animate(toAnimate);
});
function fireThis() {
if(isOn === 13) return;
(isOn < 13) ? isOn++ : isOn = 0;
switch(isOn) {
case 1:
sets = {animationType: "out", restoreHTML: false};
break;
case 2:
fx.html("TOPICS TO STIMULATE YOUR MIND");
sets = {animation: 2, linked: true, hyperlink: "http://www.thestormybrain.com/p/i.html", color: "#000000", linkTarget: "_parent"};
break;
case 3:
sets = {animation: 3, startDelay: 5000, animationType: "out", restoreHTML: false};
break;
case 4:
fx.html("COLLABORATION TIPS");
sets = {animation: 4, linked: true, hyperlink: "http://www.thestormybrain.com/p/collaboration.html", color: "#000000", linkTarget: "_parent"};
break;
case 5:
sets = {animation: 5, startDelay: 5000, animationType: "out", restoreHTML: false};
break;
case 6:
fx.html("INVENTIONS YOU COULD'VE THOUGHT OF");
sets = {animation: 6, linked: true, hyperlink: "http://www.thestormybrain.com/p/inventions.html", color: "#000000", linkTarget: "_parent"};
break;
case 7:
sets = {animation: 7, startDelay: 5000, animationType: "out", backwards: true, restoreHTML: false};
break;
case 8:
fx.html("9 IDEAS THAT HAVE CHANGED THE WORLD");
sets = {animation: 8, linked: true, hyperlink: "http://www.thestormybrain.com/p/ideas.html", color: "#000000", linkTarget: "_parent"};
break;
case 9:
sets = {animation: 9, startDelay: 5000, animationType: "out", speed: 500, easing: "easeInBack", restoreHTML: false};
break;
case 10:
fx.html("THOUGHTS THAT HAVE CHANGED THE WORLD");
sets = {animation: 10, linked: true, hyperlink: "http://www.thestormybrain.com/p/thoughts.html", color: "#000000", linkTarget: "_parent"};
break;
case 11:
sets = {animation: 13, startDelay: 5000, animationType: "out", speed: 500, easing: "easeInBack", restoreHTML: false};
break;
case 12:
fx.html("INVENTIONS THAT HAVE CHANGED THE WORLD");
sets = {animation: 14, linked: true, hyperlink: "http://www.thestormybrain.com/p/change-world.html", color: "#000000", linkTarget: "_parent"};
break;
}
jQuery.cjTextFx.animate(toAnimate, sets);
}
</script>
<div id="container">
<div id="text-fx">
<div id="effect">Here are some links to assist you!</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment