Code Monkey home page Code Monkey logo

strapdown-topbar's Introduction

strapdown-topbar

A topbar modification for strapdown.js (markdown-based webpages)
CDNJS mobile-ready

Examples

  • Example #1: Left aligned top links [link]
  • Example #2: Right aligned top links [link]
  • Example #3: (MFixed) Fixed topbar on mobile devices [link]
  • Example #4: Testing Header anchor v-alignment [link]
  • Example #5: (MFixed) Testing Header anchor v-alignment [link]

Usage

Have your topbar setting in the <body>.

<topbar style="display:none;">
	<item><a href="#">Home</a></item>
	<item><a href="#">About</a></item>
	<menu name="Dropdown Menu">
		<item><a href="#">Item #1</a></item>
		<item><a href="#">Item #2</a></item>
		<item><a href="#">Item #3</a></item>
		<item></item> <!-- add a divider -->
		<item><a href="#">Item #4</a></item>
	</menu>
	<toc>My TOC</toc>
	<item><small>(Powered by <a href="https://github.com/arturadib/strapdown">StrapDown.js</a>)</small></item>
</topbar>

Then, simply include strapdown-topbar.js AFTER strapdown.js.

<script src="https://cdn.jsdelivr.net/gh/arturadib/strapdown@gh-pages/v/0.2/strapdown.js"></script>
<!-- Include it AFTER strapdown -->
<script src="assets/strapdown/strapdown-topbar.min.js"></script>

<!-- Example: Manually adding a logo -->
<!-- Include it AFTER EVERYTHING -->
<script src="assets/logo.js"></script>

Optionally, you can include the following before the js files to force a header text color to avoid link color styling when not hovered.

var STRAPDOWN_TOPBAR_DEFAULT_COLOR = '#555';

NOTE! Want more speed? Now available on cdnjs
Or even jsDelivr: https://cdn.jsdelivr.net/gh/joedf/strapdown-topbar@latest/assets/strapdown/strapdown-topbar.min.js

strapdown-topbar's People

Contributors

joedf avatar peterdavehello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

strapdown-topbar's Issues

Transition between pages

When navigating between pages, you can see momentarily - unstyled elements of the menu code, instead of the page remaining blank. I managed to grab a screenshot of what you actually see, before the selected page fully loads.

transit

TOC not collapsing

Noticed that the TOC menu does not collapse once a selection has been made, and the only way to collapse it is to either click away from the menu, or select another menu item.
This is more of a problem when using a mobile device, because if you tap elsewhere on the screen, the TOC menu collapses, but the main menu remains expanded.
toc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.