jQuery/HTML/CSS를 단독으로 사용하여 블록 요소를 왼쪽 하단 모서리에서 오른쪽 상단으로 대각선으로 전환 할 수 있습니다. 그래서 삼각형 모양은 블록이 채워질 때까지 전환 기간을 채 웁니다.jQuery HTML CSS 효과
나는 CSS3 전환을 지원하지 않는 브라우저를 사용하는 사용자가 있기 때문에이 후입니다. 이상적으로이 크롬과 IE8에서 모두 작동 할 것은 시간이 지나면,이 내가 얻은 것을
입니다 + :
IE8에서 작동 + | 크롬 | 파이어 폭스
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
Dom, 통찰력과 도움 – goingsideways