图像的 Javascript 圆角 [英] Javascript Rounded Corners for Images

查看:71
本文介绍了图像的 Javascript 圆角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要显示带圆角的图像.很久以前,我看到一个网站使用 javascript 库执行此操作,该库将圆角图像覆盖在普通图像上.

I need to display images with rounded corner. Long time back I saw a website doing this using a javascript library that overlayed the rounded corner image over the normal image.

我们是否有任何 javascript 库(最好是 jQuery 插件)来直接对 img 标签执行此操作,而不是使用 jig 图像作为 div 的背景?

Do we have any javascript library (preferably jQuery plugin) to do this directly to img tags rather than usijg image as background for a div?

推荐答案

您可以将 CSS3 border-radius 应用于 img 元素,但结果有点不稳定.自己看看:http://jsbin.com/exiha 这解释了为什么你所谈论的覆盖是必需品.

You can apply CSS3 border-radius to img elements, but the results are a bit wonky. See for yourself: http://jsbin.com/exiha This explains why the overlay you’re talking about is a necessity.

jQuery Corner Plugin 可用于图像:http://www.malsup.com/jquery/corner/image.html

这篇关于图像的 Javascript 圆角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆