Skip to content

Instantly share code, notes, and snippets.

View nogginbox's full-sized avatar
🖱️

Richard Garside nogginbox

🖱️
View GitHub Profile
// Author: Richard Garside [www.nogginbox.co.uk]
// Ref: http://www.nogginbox.co.uk/blog/xml-to-asp-net-mvc-action-method
namespace NogginBox.MvcExtras.Providers
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Web.Mvc;
@nogginbox
nogginbox / active-section.js
Created January 11, 2021 14:26
Highlight active section link
$(document).ready(function () {
var $sections = $(".content-item");
var scrollFunc = function () {
var scrollTop = $(this).scrollTop() + ((window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) / 3);
var $activeSection = $($sections[0]);
for (var i = $sections.length - 1; i >= 0; i--) {
var $s = $($sections[i]);
var divPosition = $s.offset().top;
$activeSection = $s;