Skip to content

Instantly share code, notes, and snippets.

@tjkelly
Created October 18, 2017 18:08
Show Gist options
  • Save tjkelly/36833de90a95d7992d6c431f75eb00f8 to your computer and use it in GitHub Desktop.
Save tjkelly/36833de90a95d7992d6c431f75eb00f8 to your computer and use it in GitHub Desktop.
(function($){
"use strict";
function tjk_fixed_width(){
var widget_area = $('div.widget-area'),
widget_text = widget_area.find('aside.widget.widget_text');
if(window.scrollTop > widget_area.height()){
widget_text.addClass('f-wid');
} else {
widget_text.removeClass('f-wid');
}
}
$('window').on('scroll', function(){
tjk_fixed_width();
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment