adaptive-backgrounds.js 介绍
adaptive-background.js是一款jQuery插件,可以根据div,img标签里图片的边框颜色来动态调整父标签的背景颜色,有点类似iTunes的专辑详情的效果.
使用
adaptive-backgrounds.js的API比较容易使用,只需要在页面中先包含jQuery和adaptive-backgrounds.js文件。然后运行脚本:
<!-- lang: js -->
$(document).ready(function(){
$.adaptiveBackground.run()
});
在需要实现该效果的标签加入data-adaptive-background属性,如:
<!-- lang: html -->
<img src="/image.jpg" data-adaptive-background='1'>
或者在css指定背景图片的标签中使用该功能,比如div,需要在div标签中再加入data-ab-css-background属性,如:
<!-- lang: html -->
<div background-image: url(/some-image.jpg)' data-adaptive-background='1' data-ab-css-background='1'></div
网站地址:http://briangonzalez.github.io/jquery.adaptive-backgrounds.js/
GitHub:https://github.com/briangonzalez/jquery.adaptive-backgrounds.js
adaptive-backgrounds.js
官方网站:http://briangonzalez.github.io/jquery.adaptive-backgrounds.js/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。