Commit ebac60bc7a42861ffcb3c8b9c3c20b16cdece397
1 parent
f8f9e56c
Exists in
master
and in
2 other branches
Styling link list block only after page is ready
Showing
1 changed file
with
13 additions
and
20 deletions
Show diff stats
theme.js
| 1 | 1 | (function($) { |
| 2 | - $('.link-list-block a').each(function() { | |
| 3 | - var element = $(this); | |
| 4 | - if (element.html().length > 12) { | |
| 5 | - element.css('letter-spacing', '0px'); | |
| 6 | - } | |
| 7 | - }); | |
| 8 | - | |
| 9 | - jQuery('.link-list-block').first().wrap("<div class='colored-links'></div>"); | |
| 10 | - | |
| 11 | - jQuery(".box-2 .link-list-block .block-title").click(function(){ | |
| 12 | - jQuery(this).parent().children("ul").stop().slideToggle(); | |
| 13 | - }); | |
| 14 | - | |
| 15 | - $('#dates .date').click ( | |
| 16 | - function() { | |
| 2 | + function styleLinkListBlock() { | |
| 3 | + $('.link-list-block').first().wrap("<div class='colored-links'></div>"); | |
| 4 | + $('.link-list-block a').each(function() { | |
| 17 | 5 | var element = $(this); |
| 18 | - $('.date').removeClass('date-active'); | |
| 19 | - element.addClass('date-active'); | |
| 20 | - var dateId = element.attr('id'); | |
| 21 | - $('.lectures').hide(); | |
| 22 | - $('#lectures').find('.' + dateId).show(); | |
| 6 | + if (element.html().length > 12) { | |
| 7 | + element.css('letter-spacing', '0px'); | |
| 8 | + } | |
| 9 | + }); | |
| 10 | + $(".box-2 .link-list-block .block-title").click(function(){ | |
| 11 | + $(this).parent().children("ul").stop().slideToggle(); | |
| 23 | 12 | }); |
| 13 | + } | |
| 24 | 14 | |
| 15 | + $(document).ready(function() { | |
| 16 | + styleLinkListBlock(); | |
| 17 | + }); | |
| 25 | 18 | })(jQuery); | ... | ... |