Commit 6dd47547 by Matthew Mongeau

wip modal

parent c517b9e8
class @Modal
initialize: (options) ->
@el = options['el']
render: ->
@el.hide()
$(function() { $(function() {
var offset = $('.filter nav').offset().top; if ($('.filter nav').length > 0) {
var offset = $('.filter nav').offset().top;
$(window).scroll(function() { $(window).scroll(function() {
if (offset <= window.pageYOffset) { if (offset <= window.pageYOffset) {
return $('.filter nav').addClass('fixed-top'); return $('.filter nav').addClass('fixed-top');
} }
else if (offset >= window.pageYOffset) { else if (offset >= window.pageYOffset) {
return $('.filter nav').removeClass('fixed-top'); return $('.filter nav').removeClass('fixed-top');
} }
}); });
}
}); });
...@@ -34,3 +34,6 @@ ...@@ -34,3 +34,6 @@
</div> </div>
</section> </section>
</section> </section>
<script type="text/javascript">
new Modal({el: $(".login-modal")}).render()
</script>
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