Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8878537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:44:06+00:00 2026-06-14T19:44:06+00:00

I am new to Javascript and am trying to make a function that does

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:44:08+00:00Added an answer on June 14, 2026 at 7:44 pm

    Case Sensitive problem :

     Change e.ctrlkey by  e.ctrlKey
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to make a JavaScript function for a Google Chrome web-application that
I'm fairly new to javascript and I'm trying to make an form for my
I'm trying to create a function that will check to make sure all the
I'm new to Jquery and trying to make a http request so that I
hello im trying to make something like github treeslider im new to javascript.. but
I am trying to implement a JavaScript function that will modify the result values
I am fairly new to JavaScript and I am trying to make it so
I'm new to Javascript/jQuery and I'm trying to make a play button for HTML5
I'm trying to make a javascript function to change the value of a parameter
This is a function taken from Pro JavaScript techniques that I'm trying to understand,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.