I am new to Javascript and am trying to make a function that does one thing when you shift+click a series of images (.gif) and another when you ctrl+click them. Right now I have the code set to alert when ctrl+click has occurred, however it doesn’t work. My chrome console suggests that there is nothing obviously wrong with the code.
<script>
$('.gif').click(function(e){
if(e.ctrlkey) {
alert('ctrl pressed');
}
if(e.shiftKey) {
$(this).css({
border: 'dashed 3px black',
});
queue.push(this.id+'divless.html');
}
else {
window.location.href = this.id + '.html';
}
});
</script>
Any help is appreciated! I have looked through ws3schools conditional statements pages as well as searched stackoverflow’s related questions and cannot figure out where I have gone wrong.
Case Sensitive problem :