jquery - offset anchor link from top of page -


currently have script opens div page, when land on target page heading above div not visible hidden behind fixed header when anchor id selected form home page. want offset heading before target div visible below site header.

html...

<h2 class="section-heading toggle">content 1 heading</h2> <div id="content1" class="slide-content">content</div> 

jquery...

var hash = window.location.hash; //  if(hash != "") {     var id = hash.substr(1); // rid of #     document.getelementbyid(id).style.display = 'block';      $(hash).prev().first().addclass("open"); } 


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -