Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# Headhesive changelog

## v2.0.0

- Transitioned from Gulp to Vite build system.
- Refactored JavaScript codebase for improved efficiency and readability.
- Conducted backward compatibility testing.
- Updated the Readme file to reflect changes and provide up-to-date information.

## v1.2.4

- Fix resize event when using numerical offset
- Fix destroy method for resize event
- Changelog corrections

## v1.2.3

- Readme correction

## v1.2.2

- Fix UMD support

## v1.2.1

- Bump version to publish to npm

## v1.2.0

- Add UMD support
- Allow to select either the top or bottom of the offset element
- Update the offset position on browser resize
Expand All @@ -23,11 +35,14 @@
- Make the clone version lower z-index than original. Prevents visual overlap of both when scrolling quickly

## v1.1.1

- Fix class naming

## v1.1.0

- Call the init method internally on instance creation
- Destroy method to only destroy it's instance

## v1.0.0

- Initial
4 changes: 1 addition & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
The MIT License (MIT)

Copyright (c) 2015 Jim Cowart
# The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
# Headhesive.js

> An on-demand sticky header.

## What is it?

Headhesive.js creates an on-demand sticky header. Specify when you want your header to become fixed and the rest is magic. [View demo](http://markgoodyear.com/labs/headhesive/).

## Install
Install with npm:

```
npm install headhesive
### Install with npm

```bash
npm install
```

Install with Bower:
### Install with yarn

```
bower install headhesive (or bower install headhesive.js)
```bash
yarn install headhesive
```

## How to use?
Headhesive.js is a standalone JavaScript plugin with no dependencies. Include the [`headhesive.min.js`](dist/headhesive.min.js) *(from the [`dist/`](dist/) folder)* in the footer of your page and initialise it:

Headhesive.js is a standalone JavaScript plugin with no dependencies. Include the [`headhesive.mjs`](dist/headhesive.mjs) *(from the [`dist/`](dist/) folder)* in the footer of your page and initialise it:

```javascript
// Create a new instance of Headhesive
var header = new Headhesive('.header');
```

### Styling Headhesive.js

Headhesive.js doesn't inject any CSS styles so you can use your own to completely control how your sticky element behaves. An [example is provided in the demo](demo/css/headhesive.css).

## Options

Customise how Headhesive.js works by passing in custom options.

```javascript
Expand Down Expand Up @@ -76,17 +82,21 @@ var header = new Headhesive('.header', options);
```

## Destroy method

To destroy an instance of Headhesive.js, you can call the destroy method:

```javascript
header.destroy();
```

## Browser support

IE9+ and modern browsers.

## License

Headesive.js is licensed under the [MIT License](LICENSE).

## Demo

There is a demo available in the [demo folder](demo/) and online at [http://markgoodyear.com/labs/headhesive/](http://markgoodyear.com/labs/headhesive/).
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "Headhesive.js",
"version": "1.2.4",
"version": "2.0.0",
"homepage": "http://markgoodyear.com/labs/headhesive/",
"authors": [
"Răzvan Gheorghe <razvan@ideacat.ro> (https://ideacat.ro)",
"Mark Goodyear <hello@markgoodyear.com> (http://markgoodyear.com)"
],
"description": "An on-demand sticky header",
"description": "An on-demand sticky header. 2023 refreshed using Vite",
"main": "dist/headhesive.js",
"keywords": [
"header",
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h3>Scroll to see it in action</h3>
</div>
</footer>

<script type="text/javascript" src="../dist/headhesive.js"></script>
<script type="text/javascript" src="../dist/headhesive.mjs"></script>
<script>

// Set options
Expand Down
150 changes: 0 additions & 150 deletions dist/headhesive.js

This file was deleted.

7 changes: 0 additions & 7 deletions dist/headhesive.min.js

This file was deleted.

Loading