Skip to content

Commit

Permalink
v2.1.0 — add scrollTitle option
Browse files Browse the repository at this point in the history
  • Loading branch information
markgoodyear committed Jul 27, 2013
1 parent 4a28d57 commit 7a16403
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.1.0
- Add option to set a custom title to the <a> tag

## 2.0.0
- Code optimisations
- Destroy method
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ScrollUp 2.0.0 [![Build Status](https://travis-ci.org/markgoodyear/scrollup.png?branch=master)](https://travis-ci.org/markgoodyear/scrollup)
# ScrollUp 2.1.0 [![Build Status](https://travis-ci.org/markgoodyear/scrollup.png?branch=master)](https://travis-ci.org/markgoodyear/scrollup)

## Installing with Bower
To install scrollUp with Bower:
Expand Down Expand Up @@ -32,6 +32,7 @@ $(function () {
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: 'Scroll to top', // Text for element, can contain HTML
scrollTitle: false, // Set a custom <a> title if required. Defaults to scrollText
scrollImg: false, // Set true to use image
activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
zIndex: 2147483647 // Z-Index for the overlay
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: 'Scroll to top', // Text for element, can contain HTML
scrollTitle: false, // Set a custom <a> title if required. Defaults to scrollText
scrollImg: false, // Set true to use image
activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
zIndex: 2147483647 // Z-Index for the overlay
Expand Down
8 changes: 6 additions & 2 deletions js/jquery.scrollUp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
scrollup v2.0.0
scrollup v2.1.0
Author: Mark Goodyear - http://markgoodyear.com
Git: https://github.com/markgoodyear/scrollup
Expand All @@ -27,11 +27,14 @@
// Apply any options to the settings, override the defaults
var o = $.fn.scrollUp.settings = $.extend({}, $.fn.scrollUp.defaults, options),

// Set scrollTitle
scrollTitle = (o.scrollTitle) ? o.scrollTitle : o.scrollText,

// Create element
$self = $('<a/>', {
id: o.scrollName,
href: '#top',
title: o.scrollText
title: scrollTitle
}).appendTo('body');

// If not using an image display text
Expand Down Expand Up @@ -93,6 +96,7 @@
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: 'Scroll to top', // Text for element, can contain HTML
scrollTitle: false, // Set a custom <a> title if required. Defaults to scrollText
scrollImg: false, // Set true to use image
activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
zIndex: 2147483647 // Z-Index for the overlay
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.scrollUp.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "scrollup",
"title": "scrollUp",
"description": "A jQuery plugin to create a customisable 'Scroll to top' feature that will work with any website, with ease.",
"version": "2.0.0",
"version": "2.1.0",
"year": "2013",
"keywords": [
"jquery",
Expand Down
6 changes: 5 additions & 1 deletion src/jquery.scrollUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
// Apply any options to the settings, override the defaults
var o = $.fn.scrollUp.settings = $.extend({}, $.fn.scrollUp.defaults, options),

// Set scrollTitle
scrollTitle = (o.scrollTitle) ? o.scrollTitle : o.scrollText,

// Create element
$self = $('<a/>', {
id: o.scrollName,
href: '#top',
title: o.scrollText
title: scrollTitle
}).appendTo('body');

// If not using an image display text
Expand Down Expand Up @@ -80,6 +83,7 @@
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: 'Scroll to top', // Text for element, can contain HTML
scrollTitle: false, // Set a custom <a> title if required. Defaults to scrollText
scrollImg: false, // Set true to use image
activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
zIndex: 2147483647 // Z-Index for the overlay
Expand Down

0 comments on commit 7a16403

Please sign in to comment.