Commit d8cdef27 authored by swizzorable's avatar swizzorable Committed by Kirk Lange

make titles smaller if needed

parent 05485e54
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var title, dateOfTitle, fontSizeOfTitle, listOfA, listOfSmall, listOfArticlesDiv, divWidth;
listOfArticlesDiv = document.getElementsByClassName("articles");
for (i = 0; i < listOfArticlesDiv.length; i++) {
listOfA = document.getElementsByClassName("articles")[i].getElementsByTagName("a");
listOfSmall = document.getElementsByClassName("articles")[i].getElementsByTagName("small");
divWidth = document.getElementsByClassName("articles")[i].offsetWidth;
for (k = 0; k < listOfSmall.length; k++) {
title = $(listOfA[k]);
dateOfTitle = $(listOfSmall[k]);
fontSizeOfTitle = parseInt(title.css("font-size"));
while (title.width() + dateOfTitle.width() > divWidth)
title.css("font-size", fontSizeOfTitle -= 0.5);
title.css("display", "inline");
}
}
});
</script>
......@@ -322,6 +322,7 @@ ul {
a, a:active {
color: $white;
white-space: nowrap;
}
a:hover {
......
......@@ -2,6 +2,7 @@
layout: default
---
{% include make_smaller_titles.html %}
<div class="container-fluid index">
<div class="row">
......
......@@ -2,6 +2,7 @@
layout: default
---
{% include make_smaller_titles.html %}
<div class="container-fluid index">
<div class="row index all-posts">
......
......@@ -2,6 +2,7 @@
layout: default
---
{% include make_smaller_titles.html %}
<div class="container-fluid index">
<div class="row index all-posts">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment