js调节图片的亮度:(使用CSS3的滤镜)
1.实现点亮图标、熄灭图标的效果
效果图:
页面代码:
<!DOCTYPE html> <%@ page language="java" contentType="text/html; charset=UTF-8"%> <% String ctxPath = request.getContextPath(); request.setAttribute("ctxpath", ctxPath);//项目根路径 %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="${ctxpath}/js/jquery-1.11.3.min.js"></script> <%-- <link href="${ctxpath}/css/main.css" rel="stylesheet"> --%> <title>首页</title> <style type="text/css"> /* #headTitle img { width: 150px; height: 50px; } */ /*灰度*/ .logo_pic { -webkit-filter: grayscale(1); filter: grayscale(1); } /*亮度*/ .bright {