/    Sign up×
Community /Pin to ProfileBookmark

onclick effect

I want to apply an js effet “onclick”.
it could be replace the image or border the image or change color of the <tr>.

The problem is-
hare images are unlimited, so i don’t want to set seperate id for each image.
By any effect hare to show the image is selected, nothing much.

please note:
I use only one image file. hare image means a bulet/icon.
The page contains many paragraphs, (unlimited, dinamic) each paragraph leading a bulet image.

Please help.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@cgishackJun 29.2008 — I dont quite understand, but I think you are looking for javascript to swap images onmousedown and onmouseup events ?

if this is the case search for Image swaping in this forum or google.

I am sure you will find thousands of samples.
Copy linkTweet thisAlerts:
@bialeckiJun 29.2008 — What I think you're going to want to do is:

  • 1. Get all the images of a certain class (let's say the "bullet" class).

  • 2. Attach an "onclick" listener to each one

  • 3. Write a function that will handle the logic of what happens when each one is clicked. Depending on how you do this, you can even have each listener execute in the scope of the image link so that manipulating its properties is super easy.


  • Does this sound like what you're aiming for?
    ×

    Success!

    Help @gfvgfdmb spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...