This is the Winona State University's Darrell W. Krueger Library custom CSS for their LibGuides Research Hub. See the CSS in action at http://libguides.winona.edu/researchhub
5. Krueger Library custom JS/CSS code
10/02/13
line-height 1.5em;
}
</style>
<!-- jquery.columns was written by Karl Swedberg. See the file source for more
attribution information -->
<script
src="http://demo.libguides.com/data/custom/1/jquery.columns.js"></script>
<script type="text/javascript">
// Contributors: Dan Brubaker Horst, Laura J. Harris, thorbroo (#code4lib), Erin R.
White, Derik Badman.
// Code is licensed under a Creative Commons Atrribution license:
http://creativecommons.org/licenses/by/3.0/us
//compatibility mode for $ namespace (which might get used by other js libraries)
better to use jQuery in these cases
jQuery.noConflict();
// Wrapping with: (function($){ ...code...})(jQuery); replaces '$' with 'jQuery'.
(function($){
$(document).ready(function() {
$('#myScript').remove();
// creates the columns through the column plug loaded above
$('.mylist').columns({columns: 2});
// 'hide' function is called on each of the 'ul' elements with the class 'guide_links'
$('ul.guide_links').hide();
// DOM insert a link element inside of each of the subject list items.
$('li.subject_link').prepend('<a href="javascript://toggle guide links"
class="toggle_button">+</a>');
// enable toggle action on each Subject LI
$('li.subject_link').bind("click", function(){
// toggles text in the link between '+' and '-'.
if($(this).children('a.toggle_button').text() == '+'){
$(this).children('a.toggle_button').text('-');
} else {
$(this).children('a.toggle_button').text('+');
}
6. Krueger Library custom JS/CSS code
10/02/13
// Toggle the child 'ul' element
$(this).children('ul.guide_links').slideToggle("fast");
});
$('a.subject_link_a').contents().unwrap();
});
})(jQuery);
</script>