A timer that allows for quick implementation in your everyday projects. Developed for in-house use at Banyan Hill Publishing, LLC. This program was written using the JavaScript OOP pattern. Basic knowledge of this pattern is a recommended, but not required.

Usage
To use this timer on your site, you must insert the element and scripts into your document. Then, adjust the
timer.settingsobject properties to your specifications.You may set HTML to the
displayHeading,expiredMessage, andredirectTextproperties.Be sure to include
https://in your redirect url.⚠️ The
autoRedirectproperty:
If you set the
autoRedirectproperty totrue, then you must also include theredirectLinkproperty.Setting this property to
falseallows for you to omit theredirectLinkproperty.Example object when
autoRedirectis set totrue:timer.settings({ timerType: "deadline", deadlineDate: "2022-10-01T09:00:00", displayHeading: "Your Offer <span class='nobr'>Ends In:</span>", expiredMessage: "<h2>Offer Expired</h2> <h2 class='h4'>We're sorry you <span class='nobr'>missed it!</span></h2>", redirectText: "Let\'s Get Started!", redirectLink: "https://www.banyanhill.com", autoRedirect: true, showDays: true, showHours: true });See the full timer setup documentation below.
The timer stylesheet will be added to your document head dynamically.
Implementation
First, insert the element and scripts into your document. You may place them anywhere within the opening and closing
bodytags.Element:
<div id='deadlineTimer'></div>Scripts:
<script src="https://cloudcollective.s3.amazonaws.com/scripts/assets/countdownTimer/countdownTimer.js.gz"></script> <script type="text/javascript"></script>To initilize the Deadline Timer, you must set the
timerTypeproperty to"deadline"Next, you must include and define the following property values on your timer object:
deadlineDateexpiredMessageautoRedirectshowDaysshowHoursThe following properties and are set to
"true"by defualt. You may change them to"false"if you want to hide them:
showDaysshowHoursYou may choose to define the following property values on your timer, as they are optional:
displayHeadingredirectTextredirectLink⚠️ If you set the
autoRedirectproperty totrue, then you must also include theredirectLinkproperty.When the
autoRedirectproperty is set totrueand theredirectTextis an empty string, the default hyperlinked text will sayYou will be automatically redirected...When the
autoRedirectproperty is set tofalseand theredirectTextis an empty string, the default hyperlinked text will sayLearn about our other services.The
redirectLinkproperty default setting is hyperlinked to the Banyan Hill website.
Implementation
First, insert the element and scripts into your document. You may place them anywhere within the opening and closing
bodytags.Element:
<div id='deadlineTimer'></div>Script:
<script src="https://cloudcollective.s3.amazonaws.com/scripts/assets/countdownTimer/countdownTimer.js.gz"></script> <script type="text/javascript"></script>To initilize the Minutes Timer, you must set the
timerTypeproperty to"minutes". Next, you must include and define the following property values on your timer object:
expiredMessageautoRedirectminutesLeftsecondsLeftYou may choose to define the following property values on your timer, as they are optional:
displayHeadingredirectTextredirectLink⚠️ If you set the
autoRedirectproperty totrue, then you must also include theredirectLinkproperty.When the
autoRedirectproperty is set totrueand theredirectTextis an empty string, the default hyperlinked text will sayYou will be automatically redirected...When the
autoRedirectproperty is set tofalseand theredirectTextis an empty string, the default hyperlinked text will sayLearn about our other services.The
redirectLinkproperty default setting is hyperlinked to the Banyan Hill website.
timerType: "deadline").displayHeading property.expiredMessage property.redirectLink property (omitting this will automatically redirect to the Banyan Hill website).showDays: false and/or showHours: false properties.minutesLeft and secondsLeft properties to specific number values.You should refer to the browser console to review errors and warnings if the timer does not behave as expected (Shift + Ctrl + K on Windows and Command + Option + J on Mac;
You can also right click on the broswer's page and use the menu to inspect the page).
debugging master )Contributions are always welcomed!
If you'd like to contribute to this project, please email me at ataylor.banyanhill@gmail.com.
Please put "Countdown Timer: Banyan Hill" in the subject line, then briefly share what you'd like to contribute to this project and how you think it could be implemented.
Copyright @