Hi everyone! I'm the author of code.mu :)
I'd love to chat with my non-Russian audience. I'm looking for your feedback on the site and the translation quality. Let's chat:)
⊗jqEftFM 108 of 113 menu

fadeToggle method in jQuery

The method fadeToggle works similarly to the method slideToggle, it also implements alternating effects: sometimes it shows the element, sometimes it hides it.

For example, we can show and hide an element by clicking on the same button. Let's implement this method using the following HTML code:

<button id="toggle">click me</button> <div id="elem">text...</div>

Let the CSS look like this:

#elem { padding: 10px; width: 150px; height: 150px; border: 1px solid green; margin-top: 10px; }

We write the following Javascript code:

$('#toggle').click(function() { $('#elem').fadeToggle(1000); });
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline