In html there is a code:
<div id="switchGal"> <p>Показать/Скрыть галерею</p> </a> </div> <div id="gallery"> <div id="big"> <img src="images/gal/start.jpg" alt="Старт" /> </div> <div id="small"> <a href="images/gal/1.jpg"> <img src="images/gal/1_mini.jpg" alt="Миниатюра 1" /> </a> <a href="images/gal/2.jpg"> <img src="images/gal/2_mini.jpg" alt="Миниатюра 2" /> </a> <a href="images/gal/3.jpg"> <img src="images/gal/3_mini.jpg" alt="Миниатюра 3" /> </a> <a href="images/gal/4.jpg"> <img src="images/gal/4_mini.jpg" alt="Миниатюра 4" /> </a> </div> </div>
Here is the script that should hide the gallery and show:
$(document).ready(function () { $('#small a').click(function (eventOject) { $('#big img').hide().attr('src', $(this).attr('href')); $('#big img').load(function () { $(this).fadeIn(1000); }); return false; }); // конец click $('#switchGal').toggle(function () { $('#gallery').fadeToggle(2000); }, function () { $('#gallery').fadeToggle(2000); }); }); //конец ready
In the css block gallery hidden initially.
The problem is that the text "Show / Hide Gallery" itself is hidden, but the gallery should be shown at the first click, while the second one is hidden. I do not know what the error is, tell me, please.