0

i integrated this script into my website: www.codepen.io/JFeremy/pen/QjpRaN?limit=all&page=2&q=language

How can i use small images as buttons instead of the text buttons? As soon as i change the text with an image,the translating function does not work anymore...

Can anybody tell me what i have to change to use small flags as buttons to change the language?

Thank you very much, Daniela

2 Answers2

0

Using JQuery: You can use the $("#myClass") or $(".myId") selector to fetch the Jquery image object. Then apply the .click() method just like this:

let myObject = $(".myId");
myObject.click( () => {
    // handle the function here
})
Izio
  • 378
  • 6
  • 15
  • Thanks for your idea, but i have no clue where to integrate this code. can you help me. You finde the code of the script on the link i posted in the question :) – D-Summer Apr 06 '18 at 11:15
0

Maybe try something like this ?

#fr_click {
background-image: url('https://cdn.countryflags.com/thumbs/france/flag-400.png');
background-size: cover;
}

Just change the background of this button with img in Css ?

Mariusz
  • 149
  • 2
  • 8
  • Thank you, but i wanted to get rid of the text for "Fr" and "En". But as soon as i remove it, the function doesnt work anymore. thx – D-Summer Apr 06 '18 at 11:19