You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
907 B
30 lines
907 B
$(function () {
|
|
|
|
// Hints
|
|
$('.hint').replaceWith(function () {
|
|
return '<div><a href="#" class="hintlink" onclick="$(this).next().slideToggle(); return false;">Bekijk hint</a>' + $(this).hide()[0].outerHTML + '</div>';
|
|
});
|
|
$('#difficulty').trigger('change');
|
|
|
|
$('#difficulty').change(function (e) {
|
|
var option = $(this).find(':selected').val();
|
|
|
|
$('.hintlink').toggle(option == 'normal');
|
|
$('.hint').toggle(option == 'easy');
|
|
|
|
window.localStorage.setItem('difficulty', option);
|
|
});
|
|
|
|
// Set the selected property
|
|
if (window.localStorage['difficulty']) {
|
|
var difficulty = window.localStorage['difficulty'];
|
|
} else {
|
|
var difficulty = 'normal';
|
|
}
|
|
|
|
$('#difficulty option').filter(function () {
|
|
return $(this).val() == difficulty;
|
|
}).prop('selected', true);
|
|
$('#difficulty').trigger('change');
|
|
|
|
}); |