Можно использовать только с помощью jQuery/HTML/CSS для анимации диагонального перехода элемента блока из нижнего левого угла в верхнее правое. Итак, треугольная форма заполняет переходный период до заполнения блока?jQuery HTML CSS-эффекты
Я после этого, поскольку у меня есть пользователи с браузерами, которые не поддерживают переходы CSS3. В идеале это будет работать как в Chrome и IE8 +
После времени, это то, что я получил:
Работает в IE8 + | Хром | Firefox
CSS
div.arrow {
width: 0;
height: 0;
border-left: 0px solid transparent; /* left arrow slant */
border-right: 50px solid transparent; /* right arrow slant */
border-bottom: 50px solid #bb0000; /* bottom, add background color here */
font-size: 0;
line-height: 0;
bottom: 0;
position: absolute;
}
div.cover {
width: 0;
height: 0;
border-left: 0px solid transparent; /* left arrow slant */
border-right: 50px solid transparent; /* right arrow slant */
border-bottom: 50px solid #FFF; /* bottom, add background color here */
font-size: 0;
line-height: 0;
bottom: -1px;
left: 0px;
z-index: 100;
position: absolute;
}
div.topLeft {
overflow: hidden;
position: absolute;
height: 300px;
width: 300px;
border: 1px solid #bb0000;
}
div.topRight {
overflow: hidden;
position: absolute;
left: -2px;
top: -2px;
height: 300px;
width: 300px;
border: 1px solid #bb0000;
}
div.wrap {
overflow: hidden;
position: absolute;
height: 300px;
width: 300px;
border: 0px solid #bb0000;
}
HTML
<div class="wrap">
<div class="topLeft"></div>
<div class="topRight"></div>
<div class="cover"></div>
<div class="arrow"></div>
</div>
JQuery
$(".wrap").hover(function(){
arrow = $(this).find(".arrow");
$(arrow).stop().animate({
borderBottomWidth: "600px",
borderRightWidth: "600px"
}, 500)
},function(){
arrow = $(this).find(".arrow");
$(arrow).stop().animate({
borderBottomWidth: "50px",
borderRightWidth: "50px"
}, 500)
});
Да, это возможно. Другие вопросы? – Dom
Да, это возможно с javascript/jQuery, но мы не можем сделать это за вас. Что вы пробовали? Без попытки эта тема может быть закрыта ... – Xarcell
Дом, проницательный и полезный – goingsideways