Выделение текста
Здравствуйте,помогите,пожа луйста, как сделать выделение текста как на этом сайте http://www.alternativ.be/ ?Чтобы при наведении курсора на текст он "крутился" сверху вниз и менял цвет.Если можно,написаль код для этого,спрашивает новичок.
Заранее огромное спасибо!!! |
joundlevel,
:cray: :cray: :cray: <!DOCTYPE HTML> <html> <head> <title>Untitled</title> <meta charset="utf-8"> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <style type="text/css"> .box { position:absolute; left:25%; top:40px; display:block; height:50px; background:#696969 } .cache { float:left; display:block; position:relative; width:150px; height:20px; overflow:hidden; margin-top:15px } a { color:#FFF; text-transform:uppercase; font-size:14px; font-weight:bolder; margin-left:17px; position:absolute; top:0px; left:0px } a.on { color:#F30; position:absolute; top:20px; left:0px } </style> </head> <body> <div class="box"> <div class="cache"> <a href="#">javascript.ru</a> <a href="#" class="on">javascript.ru</a> </div> <div class="cache"> <a href="#">javascript.ru</a> <a href="#" class="on">javascript.ru</a> </div> <div class="cache"> <a href="#">javascript.ru</a> <a href="#" class="on">javascript.ru</a> </div> </div> <script type="text/javascript"> $(".cache").hover(function (event) { $(this).children().stop(true, true); $(this).children().eq(0).animate({ top: "-20px" }, 200) $(this).children().eq(1).animate({ top: "0px" }, 200) }, function (event) { $(this).children().stop(true, true); $(this).children().eq(0).animate({ top: "0px" }, 200) $(this).children().eq(1).animate({ top: "20px" }, 200) }) </script> </body> </html> |
рони,
глючит твой скрипт, при быстром перемещении мыши по пунктам, они просто пропадают... Сижу на Опере |
devote,
хотел сократить код но вышло боком ... поправил ... посмотрите как сейчас. |
Цитата:
Хотя можно чисто на css решить засунув пару ccылок в block c overflow:hidden; |
Цитата:
|
joundlevel, начинай отсюда
![]() |
в нормальных браузерах это можно сделать без скриптов:
<style> .cache { height: 20px; overflow-y: hidden; float: left; margin: 0 10px; } .cache:hover a:first-child { margin-top: -19px; } .cache a { color: green; display: block; margin-top: 0px; -webkit-transition: margin-top 0.2s ease; -ms-transition: margin-top 0.2s ease; -o-transition: margin-top 0.2s ease; transition: margin-top 0.2s ease; } .cache a:last-child { color: red; } </style> <div class="box"> <div class="cache"> <a href="#">javascript.ru</a> <a href="#">javascript.ru</a> </div> <div class="cache"> <a href="#">javascript.ru</a> <a href="#">javascript.ru</a> </div> <div class="cache"> <a href="#">javascript.ru</a> <a href="#">javascript.ru</a> </div> </div> |
Jasmine - spam bot?
|
Ребят,а что нужно поменять в коде,чтобы текст уходил не вверх,а в бок(лево).
Буду очень признателен! <style> .cache { height: 20px; overflow-y: hidden; float: left; margin: 0 10px; } .cache:hover a:first-child { margin-top: -19px; } .cache a { color: green; display: block; margin-top: 0px; -webkit-transition: margin-top 0.2s ease; -ms-transition: margin-top 0.2s ease; -o-transition: margin-top 0.2s ease; transition: margin-top 0.2s ease; } .cache a:last-child { color: red; } </style> <div class="box"> <div class="cache"> <a href="#">javascript.ru</a> <a href="#">javascript.ru</a> </div> <div class="cache"> <a href="#">javascript.ru</a> <a href="#">javascript.ru</a> </div> <div class="cache"> <a href="#">javascript.ru</a> <a href="#">javascript.ru</a> </div> </div> |
Много всего уже перепробывал,не получается
|
Цитата:
Цитата:
Цитата:
|
Часовой пояс GMT +3, время: 19:14. |