Jquery Selecting image

前端 未结 5 1019
孤街浪徒
孤街浪徒 2021-01-07 06:06

primarily, i\'m new for Jquery.

I have images like that . What i want is that when user click image,it makes image bordered. User can select a number of images. It

5条回答
  •  别那么骄傲
    2021-01-07 06:22

    Easy enough, just add a new CSS class to the image on click.

    
    ...
    
    ...
    
    
    
    
    
    

    I prefer this method to in-script style definitions for the sake of simply removing stylistic elements from functionality. Makes everything reusable and easy to change later if need be. Above code supports both applying the formatting and removing it on a secondary click. (IE: It will remove if it exists.)

提交回复
热议问题