app/assets/javascripts/topnav.js.erb
$().ready(function (){
renderBackground("<%= asset_path('background.jpg') %>")
/* Navigation */
$('.top-content .text').waypoint(function(){
$('nav').toggleClass('navbar-no-bg');
});
/* Dropdowns */
$('.dropdown-toggle').dropdown();
/* Wow */
new WOW({live: false}).init();
/* Placeholders */
// $('input[type="text"], input[type="password"], textarea').each(function(){
// $(this).val( $(this).attr('placeholder') );
// });
});
function renderBackground(imgUrl){
/* Background slideshow */
$('.top-content').backstretch(imgUrl);
$('#top-navbar-1').on('shown.bs.collapse hidden.bs.collapse', function(){
$('.top-content').backstretch("resize");
});
}