summaryrefslogtreecommitdiff
path: root/scrolling-title
diff options
context:
space:
mode:
authors1n <[email protected]>2020-03-04 01:58:07 -0800
committerGitHub <[email protected]>2020-03-04 01:58:07 -0800
commitb1df5a6c1cd87016797a0582875ad6bd315010ff (patch)
treecd3f6aadf7568819a70c7661f4d1d3ad63fe2d07 /scrolling-title
downloadhtml-examples-b1df5a6c1cd87016797a0582875ad6bd315010ff.tar.xz
html-examples-b1df5a6c1cd87016797a0582875ad6bd315010ff.zip
Diffstat (limited to 'scrolling-title')
-rw-r--r--scrolling-title/README.md7
-rw-r--r--scrolling-title/index.html30
-rw-r--r--scrolling-title/js/main.js12
3 files changed, 49 insertions, 0 deletions
diff --git a/scrolling-title/README.md b/scrolling-title/README.md
new file mode 100644
index 0000000..4af7851
--- /dev/null
+++ b/scrolling-title/README.md
@@ -0,0 +1,7 @@
+# Scrolling Title
+
+
+You can either choose to link the external Javascript to your index.html or you can include a Javascript `<script>` tag in the `<head>` or `<body>`
+
+*I chose to link the external Javascript but you can just comment tag it out and un-comment tag the `<script>` above it.*
+
diff --git a/scrolling-title/index.html b/scrolling-title/index.html
new file mode 100644
index 0000000..22071bd
--- /dev/null
+++ b/scrolling-title/index.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>s1nical - Scrolling Title</title>
+ <!--<script language="JavaScript">
+ var space = " ";
+ var speed = "60";
+ var pos = 0;
+ var msg = "// s1n.ical "; /*Enter the scrolling title as the msg variable's value.*/
+
+ function Scroll() {
+ document.title = msg.substring(pos, msg.length) + space + msg.substring(0, pos);
+ pos++;
+ if (pos > msg.length) pos = 0;
+ window.setTimeout("Scroll()", speed);
+ }
+ Scroll();
+ </script>-->
+ <script src="js/main.js"></script>
+ </head>
+
+ <body>
+
+ </body>
+
+</html> \ No newline at end of file
diff --git a/scrolling-title/js/main.js b/scrolling-title/js/main.js
new file mode 100644
index 0000000..f2b20ac
--- /dev/null
+++ b/scrolling-title/js/main.js
@@ -0,0 +1,12 @@
+var space = " ";
+var speed = "60";
+var pos = 0;
+var msg = "// s1n.ical "; /*Enter the scrolling title as the msg variable's value.*/
+
+function Scroll() {
+ document.title = msg.substring(pos, msg.length) + space + msg.substring(0, pos);
+ pos++;
+ if (pos > msg.length) pos = 0;
+ window.setTimeout("Scroll()", speed);
+}
+Scroll(); \ No newline at end of file