kotkotan Posted June 12, 2013 Posted June 12, 2013 На просторах сети наткнулся на подобный спойлер для Престы: <div class="spoil"> <div class="smallfont"><input class="input-button" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = '>>> Cкрыть <<<'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = '<<< Показать >>>'; }"type="image" src="ссылка на картинку" /></div> <div class="alt2"> <div style="display: none;"> <p style="text-align: center;"> ТЕКСТ ПОД СПОЙЛЕРОМ </p> </div> </div> </div> смысл в том, чтобы при нажатии на картинку открывался текст/графика. подскажите как доработать, чтобы при наведении на картинку она подсвечивалась или подставлялалась другая картинка, например была черно-белая, а при наведении стала цветной. спасибо Share this post Link to post Share on other sites More sharing options...
absent Posted June 12, 2013 Posted June 12, 2013 используйте fadein fade out имхо удобнее Share this post Link to post Share on other sites More sharing options...
kotkotan Posted June 12, 2013 Posted June 12, 2013 используйте fadein fade out имхо удобнее а можно на примере? Share this post Link to post Share on other sites More sharing options...
absent Posted June 12, 2013 Posted June 12, 2013 а можно на примере? http://jquery-docs.ru/effects/fadeout/ http://jquery-docs.ru/effects/fadein/ Share this post Link to post Share on other sites More sharing options...
kotkotan Posted June 12, 2013 Posted June 12, 2013 с этими примерами я не разберусь. есть идеи как доработать тот код, который выложил выше? Share this post Link to post Share on other sites More sharing options...
absent Posted June 12, 2013 Posted June 12, 2013 напиши в поиске fadeIn и fadeOut и смотри. там легко. Share this post Link to post Share on other sites More sharing options...
kotkotan Posted June 13, 2013 Posted June 13, 2013 напиши в поиске fadeIn и fadeOut и смотри. там легко. здесь на форуме не нахожу.... Share this post Link to post Share on other sites More sharing options...
Dimitri Yelquin Posted June 15, 2013 Posted June 15, 2013 Это не на форуме. Посмотрите в Гугле! Share this post Link to post Share on other sites More sharing options...
absent Posted June 15, 2013 Posted June 15, 2013 (edited) здесь на форуме не нахожу.... http://jquery-docs.ru/effects/fadein/ Edited June 15, 2013 by absent (see edit history) Share this post Link to post Share on other sites More sharing options...
kotkotan Posted June 17, 2013 Posted June 17, 2013 с jQuery какие-то проблемы. при вставке скрипта он закрывается каким-то [CDATA] Share this post Link to post Share on other sites More sharing options...
absent Posted June 18, 2013 Posted June 18, 2013 с jQuery какие-то проблемы. при вставке скрипта он закрывается каким-то [CDATA] Как вставляешь? Share this post Link to post Share on other sites More sharing options...
kotkotan Posted June 18, 2013 Posted June 18, 2013 Пробую эффект "Черно-бело становится цветным при наведении" Подключаю <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/grayscale.js"></script> Изображения <img class="color" src="img/g1.png"> <img class="color" src="img/g2.png"> Дальше скрипт <script type="text/javascript"> $(document).ready(function(){ grayscale.prepare($('.color')); grayscale($('.color')); $('.color').hover(function(){ grayscale.reset($(this)); }, function(){ grayscale($(this)); }); }); </script> После обновления скрипт помещается в <![CDATA[// ]]> и с картинкой ничего не происходит Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now