-
Notifications
You must be signed in to change notification settings - Fork 1
/
overview.js
35 lines (28 loc) · 1.06 KB
/
overview.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var defaultRegion = 'northwest_atlantic';
$(document).ready(function() {
// Listen for changes in the radio buttons
$('input[name="regionOptions"]').change(function() {
// Get the ID of the selected label
var labelId = $(this).next('label').attr('for');
console.log('Portal default region :', labelId);
// change all regions to the radio options
// chooseDefaultRegion('reg-mom-cobalt',labelId)
});
});
// slow animate transition to CEFI detail info
$(document).ready(function(){
$("#detailCEFIButton").click(function() {
$('html, body').animate({
scrollTop: $("#detailCEFI").offset().top
}, 1000);
});
});
// function for create option for general options
function chooseDefaultRegion(selectClass,defaultValue) {
let elms = document.getElementsByClassName(selectClass);
// loop through all region dropdown with the selectClassName
for(let i = 0; i < elms.length; i++) {
// Set the default option based on the option value
elms[i].value = defaultValue
}
};