Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Commit

Permalink
Fix onLoad setClickFrame
Browse files Browse the repository at this point in the history
This fixes #1.
  • Loading branch information
anselmh committed May 22, 2013
1 parent cd06d62 commit b11f563
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,18 @@ <h3>Warsaw at Night</h3>
}

// Set clickable frame on Slider

var setClickFrame = function() {
window.addEventListener('DOMContentLoaded', function() {

var getContainer = document.getElementsByClassName('banner-main--feature');
var newNode = document.createElement("a");

var getHashId = window.location.hash.match(/\d+(\.\d+)?/g);
getHashId = parseInt(getHashId[0]);
var getHashId = 1; // Set initial value to 1 as this the 1st is always loaded

if(window.location.hash !== '') {
getHashId = window.location.hash.match(/\d+(\.\d+)?/g);
getHashId = parseInt(getHashId[0]);
}

var maxCount = document.querySelectorAll('.slider-content > li').length;
var nextItem;

Expand All @@ -287,7 +291,7 @@ <h3>Warsaw at Night</h3>
newNode.setAttribute('href', '#slide-'+nextItem);

getContainer[0].appendChild(newNode);
}
});

window.addEventListener('hashchange', function() {

Expand Down Expand Up @@ -330,7 +334,6 @@ <h3>Warsaw at Night</h3>
}

// Initialize all the things
window.addEventListener('load', setClickFrame);

if(window.location.hash.indexOf("slide-") >= 0) {
window.addEventListener('load', setActiveItems);
Expand Down

0 comments on commit b11f563

Please sign in to comment.