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 9202849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:20:46+00:00 2026-06-17T23:20:46+00:00

I want to blur my images by clicking on it. I am using javascript

  • 0

I want to blur my images by clicking on it. I am using javascript on click event for this purpose. But it is not working exactly as I want. My code is given below:

<script>
$(document).ready(function(){


  $(".ww").click(function(){
    $(this).css("opacity","0.2");
  });
});
</script>

<div class="bg">
    <div class="img ww1"><center><img src="img.jpg" /></center></div>
    <div class="canname"><center>GHULAM MUSTAFA</center></div>
    <div class="partyname"><center>JATOI &nbsp;&nbsp; <span style="color:#CCC;">NPP</span></center></div>
</div>

<div class="bg">
    <div class="img ww2"><center><img src="img.jpg" /></center></div>
    <div class="canname"><center>GHULAM MUSTAFA</center></div>
    <div class="partyname"><center>JATOI &nbsp;&nbsp; <span style="color:#CCC;">NPP</span></center></div>
</div>

I want that when I click first image then its opacity would set. And that when I click second image so the opacity of first image would finish and second image would set.

  • 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-17T23:20:47+00:00Added an answer on June 17, 2026 at 11:20 pm

    As the others already tried to explain, you have to use a selector which actually selects both elements, since you want to bind the event handler to both of them. $('.ww') does not select any element in the code you posted.

    Toggling the opacity can be easier done when using a class:

    .selected {
        opacity: 0.2;
    }
    

    Add the class to the clicked element and removed it from the element currently having the class:

    $(".img").click(function(){
        $('.img.selected').add(this).toggleClass('selected');
    });
    

    Have a look at this DEMO. This should give you enough information to apply it to your situation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to do this here http://wonderfl.net/c/9Kdv but what I want is not
I am using the following code to blur an image in android, but it
want to rewrite urls like site.com/software to wp-content/themes/dir/software.php and something is not working.. Here's
I just want to click on the image and then see it blur out.
I want to blur my image using the native Gaussian blur formula. I read
I'm using qTip2 and with my Umbraco installation. I want my images inserted into
I am working on one thing and instead of using big images I would
I'm using WPF 3.5 SP1 and I want to achieve something like this (the
I'm using the Pixastic plugin in JavaScript. I have a table filled with images
I want to sharpen images in my app. I found this post how to

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.