Useful solutions

Useful solutions – articles, how-to-fix notes, fast solutions

Show and hide block with js

Few examples for showing a block on button click. Example 1: easy to use <script type="text/javascript"> function openlink(id){ display = document.getElementById(id).style.display; if(display=='none'){ document.getElementById(id).style.display='block'; }else{ document.getElementById(id).style.display='none'; } } </script> The block will be opened by clicking on the link: <a href="#" onclick="openlink('mylink'); return false">Open the link</a> Content will be shown when …

Read More »

Contact form 7 with spoilers/accordion

I needed to publish a questionnaire, with answer options opening by clicking on a question. There were no ready-made plugins for implementation, so I made a code for use: Contact Form 7 with accordion Full form template (sorry for the RU answer options): <div class="tabs"> <div class="tab"><input type="radio" id="rd1" name="rd"><label …

Read More »