Commit 68dbb0d5 authored by Porter Libby's avatar Porter Libby
Browse files

career community selector (simple)

parent db3d9f49
var career_community = [
{
"name" : "community 1",
"desc" : "community 1 description"
},
{
"name" : "community 2",
"desc" : "community 2 description"
},
{
"name" : "community 3",
"desc" : "community 2 description"
},
{
"name" : "community 4",
"desc" : "community 2 description"
}
]
\ No newline at end of file
......@@ -10,8 +10,12 @@
<body>
<div id='flow-chart-container'>
</div>
<!-- LOCAL FILES -->
<script src="public/js/main.js"></script>
<script src="data/careers-data.js"></script>
<script src="data/career_community-data.js"></script>
<script src="public/js/careers.js"></script>
<script src="public/js/career_community.js"></script>
</body>
</html>
\ No newline at end of file
console.log(career_community); // show json structure from 'data/careers-data.js'
var career_community_counter = 0;
var container_name = 'Career Community';
var container = document.getElementById(container_name);
var text_display = document.createElement('span');
text_display.innerHTML = career_community[0].name;
var prev_button = document.createElement('button');
prev_button.innerHTML = "<";
var next_button = document.createElement('button');
next_button.innerHTML = ">";
text_display.style.display = 'inline';
prev_button.style.display = 'inline';
next_button.style.display = 'inline';
var selector = document.createElement('div');
selector.style.textAlign = 'center';
selector.style.marginTop = '50%';
selector.style.color = 'white'
selector.appendChild(prev_button);
selector.appendChild(text_display);
selector.appendChild(next_button);
container.appendChild(selector);
prev_button.onclick = function(){
career_community_counter--;
if (career_community_counter == -1){
career_community_counter = career_community.length - 1;
}
text_display.innerHTML = career_community[career_community_counter].name;
}
next_button.onclick = function(){
career_community_counter++;
if (career_community_counter == career_community.length){
career_community_counter = 0;
}
text_display.innerHTML = career_community[career_community_counter].name;
}
......@@ -25,7 +25,7 @@ var items = [{
'column': 1
},
{
'name': "Career Exploration",
'name': "Career Community",
'items': [],
'type': "circle-1",
'column': 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment