Помогите с jquery
есть код
$(function(){ // $('.slider').hide(); var select = $('.slider:first-child'); // select.show(); $('.next').click(function(){ select.hide(); select=select.next(); if (!select.length){ select= $('.slider:first-child'); } select.show(); return false; }); }); и вот это: <div id="start"> <div class="slider"></div> <div class="slider">Hi my name Vuchastyi Igor</div> <div class="slider">Hi my name Vuchastyi Igddor</div> </div> <div id="next" class="demo"> <a href="#" class="next">next</p> </div> и вот это #start{ background-color: rgba(0, 0, 0, 0.3); position:fixed; left:0%; top: 0%; right:0%; bottom: 0%; width: 100%; height: 100%; } #next{ background-color: rgba(255, 0, 0, 0.3); position:fixed; right:2%; bottom: 2%; width: 6%; height: 3%; } .slider:not(:first-child){ display: none; } Вопрос в следующем: мне нужно чтоб по окончанию всех div с классом slider, div с id="next" менял текст на close, и при нажатии на close закрывалось два дива: id=start и id=next :help: |
Цитата:
|
да ну, помоги это же просто для профи, а я туповат в jquery пока что:)
|
рони,
я уже в большей части разобрался, помоги сделать чтоб в конце всех дивов с класcом slider; див с классом next не перелистывался заново а просто останавливался после последнего дива с slider |
vuchastyi,
я не понимаю что вы хотите сделать, похоже не я один, иначе вам давно бы подсказали. |
vuchastyi,
так? <!DOCTYPE HTML> <html> <head> <title>Untitled</title> <meta charset="utf-8"> <style type="text/css"> #start{ background-color: rgba(0, 0, 0, 0.3); position:fixed; left:0%; top: 0%; right:0%; bottom: 0%; width: 100%; height: 100%; } #next{ background-color: rgba(255, 0, 0, 0.3); position:fixed; right:2%; bottom: 15%; width: 6%; height: 3%; } .slider:not(:first-child){ display: none; } </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script> $(function(){ // $('.slider').hide(); var select = $('.slider:first-child'); // select.show(); $('.next').click(function(){ select.hide(); select=select.next(); if (select.length){ select.show(); } else{ $('#start, #next').hide() } return false; }); }); </script> </head> <body> <div id="start"> <div class="slider">1</div> <div class="slider">2Hi my name Vuchastyi Igor</div> <div class="slider">3Hi my name Vuchastyi Igddor</div> </div> <div id="next" class="demo"> <a href="#" class="next">next</a> </div> </body> </html> |
о да:D большое спасибо)))
|
рони,
о да большое спасибо))) |
Часовой пояс GMT +3, время: 00:45. |