November 5, 201511 yr I've seen it on some sites.. and a quick google I couldn't really see how it's done.. how do I do something like that? http://pro.sony.com/bbsc/ssr/show-highend/resource.solutions.bbsccms-assets-show-highend-f65.shtml
November 14, 201511 yr Author Anyone have any ideas about this: https://pro.sony.com/bbsc/ssr/show-highend/resource.solutions.bbsccms-assets-show-highend-f65camera.shtml
November 15, 201511 yr It's done by hiding a background image using a negative position. Then on hover, transitioning it back to its default 0 0 position.The site you linked to uses a .png image, but you could easily just use a linear gradient.http://jsfiddle.net/cpejstrk/
November 15, 201511 yr Can't believe, even today how many websites are still released that are using images for things that can be easily replicated with a bit of CSS. We have gradients, shadows, border-radius's even shapes in modern browsers. For more complex shapes we have SVG.
November 17, 201511 yr Author https://www.trevorsiu.com/frametest2.html How do I make the li a:hover do the same thing..
November 17, 201511 yr Not sure the above will work because the anchors are initially set to display none, so they don't have a background position to animate from?You'd be better using keyframes instead.here's your code updated. @keyframes bg-slide { from { background-position: 0 -2em } to { background-position: 0 0 } } #menu label{background:linear-gradient(#D4AF37,#D4AF37)no-repeat #101010 0em -2em;border:1px #151515 solid;border-top-left-radius:2.5px;border-top-right-radius:2.5px;color:white;cursor:default;display:block;font-family:candara;font-size:17px;line-height:34px;text-decoration:none;} #menu a{border-bottom:1px #151515 solid;border-left:1px #151515 solid;border-right:1px #151515 solid;color:white;display:block;font-family:candara;font-size:17px;line-height:34px;text-decoration:none;} #menu ul{display:inline-block;list-style:none;padding:0px;} #menu ul ul{display:none;} #menu li:hover ul{display:inline;} #menu>ul>li{float:left;width:90px;} #menu>ul>li:first-of-type,#menu>ul>li:first-of-type label{border-top-left-radius:6.25px 12.5px;} #menu>ul>li:last-of-type,#menu>ul>li:last-of-type label{border-top-right-radius:6.25px 12.5px;} #menu>ul>li>ul>li>a{background:linear-gradient(#D4AF37,#D4AF37)no-repeat #101010 0em -2em;border-bottom-left-radius:6.25px 12.5px;border-bottom-right-radius:6.25px 12.5px;color:white;} #menu>ul>li:first-of-type>ul>li a{border-bottom-left-radius:6.25px 12.5px;} #menu>ul>li:last-of-type>ul>li a{border-bottom-right-radius:6.25px 12.5px;} #menu li a:hover { animation: bg-slide 0.25s 0.2s forwards } #menu li:hover label { animation: bg-slide 0.25s forwards; color: black } If you want one fluid animation change #menu li a:hover to #menu li:hover a Can't believe, even today how many websites are still released that are using images for things that can be easily replicated with a bit of CSS. We have gradients, shadows, border-radius's even shapes in modern browsers. For more complex shapes we have SVG. I know. People who still use images for buttons just means a lot more work if changes are needed.
November 19, 201511 yr Author https://www.trevorsiu.com/frametest3.html This one with the animation.. isn't so good in Internet Explorer/Edge lol. I was thinking of using it.
November 20, 201510 yr Author Yea that's as far as I got with: https://www.trevorsiu.com/frametest3.html I combined the best of both to get the same effect.. Works great in Chrome and Firefox.. just not Internet Explorer/Edge.
Create an account or sign in to comment