bookmark

css - What is the simplest jQuery way to have a 'position:fixed' (always at top) div? - Stack Overflow


Description

$(document).ready(function() { $("#topBar").css("position", "absolute"); });

$(window).scroll(function() { $("#topBar").css("top", $(window).scrollTop() + "px"); });

Preview

Tags

Users

  • @sac

Comments and Reviews