- 浏览: 242759 次
- 性别:
- 来自: 南京
-
最新评论
-
gonglil:
貌似不行呢?
java 字符串和二进制相互转换 -
robingdo:
这样关闭proxool连接池以后,项目没报那个错,但是数据库用 ...
Proxool连接池在reload web容器时出现HouseKeeper的空指针异常 -
xb12369:
ezfantasy 写道lord_is_layuping 写道 ...
Java忽略大小写替换和提取字符信息 -
ezfantasy:
lord_is_layuping 写道不区分大小写应该是(?i ...
Java忽略大小写替换和提取字符信息 -
狂盗一枝梅:
hex2byte函数功能是转换成十六进制吧?上面写的是转换成二 ...
java 转换图片为字符串,将字符串转换成图片显示
网址:http://dillerdesign.com/experiment/DD_belatedPNG/
/** * DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>. * Author: Drew Diller * Email: drew.diller@gmail.com * URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/ * Version: 0.0.7a * Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license * * Example usage: * DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector * DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement **/ /* PLEASE READ: Absolutely everything in this script is SILLY. I know this. IE's rendering of certain pixels doesn't make sense, so neither does this code! */ var DD_belatedPNG = { ns: 'DD_belatedPNG', imgSize: {}, createVmlNameSpace: function() { /* enable VML */ if (document.namespaces && !document.namespaces[this.ns]) { document.namespaces.add(this.ns, 'urn:schemas-microsoft-com:vml'); } if (window.attachEvent) { window.attachEvent('onbeforeunload', function() { DD_belatedPNG = null; }); } }, createVmlStyleSheet: function() { /* style VML, enable behaviors */ /* Just in case lots of other developers have added lots of other stylesheets using document.createStyleSheet and hit the 31-limit mark, let's not use that method! further reading: http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx */ var style = document.createElement('style'); document.documentElement.firstChild.insertBefore(style, document.documentElement.firstChild.firstChild); var styleSheet = style.styleSheet; styleSheet.addRule(this.ns + '\\:*', '{behavior:url(#default#VML)}'); styleSheet.addRule(this.ns + '\\:shape', 'position:absolute;'); styleSheet.addRule('img.' + this.ns + '_sizeFinder', 'behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;'); /* large negative top value for avoiding vertical scrollbars for large images, suggested by James O'Brien, http://www.thanatopsic.org/hendrik/ */ this.styleSheet = styleSheet; }, readPropertyChange: function() { var el = event.srcElement; if (event.propertyName.search('background') != -1 || event.propertyName.search('border') != -1) { DD_belatedPNG.applyVML(el); } if (event.propertyName == 'style.display') { var display = (el.currentStyle.display == 'none') ? 'none' : 'block'; for (var v in el.vml) { el.vml[v].shape.style.display = display; } } if (event.propertyName.search('filter') != -1) { DD_belatedPNG.vmlOpacity(el); } }, vmlOpacity: function(el) { if (el.currentStyle.filter.search('lpha') != -1) { var trans = el.currentStyle.filter; trans = parseInt(trans.substring(trans.lastIndexOf('=')+1, trans.lastIndexOf(')')), 10)/100; el.vml.color.shape.style.filter = el.currentStyle.filter; /* complete guesswork */ el.vml.image.fill.opacity = trans; /* complete guesswork */ } }, handlePseudoHover: function(el) { setTimeout(function() { /* wouldn't work as intended without setTimeout */ DD_belatedPNG.applyVML(el); }, 1); }, /** * This is the method to use in a document. * @param {String} selector - REQUIRED - a CSS selector, such as '#doc .container' **/ fix: function(selector) { var selectors = selector.split(','); /* multiple selectors supported, no need for multiple calls to this anymore */ for (var i=0; i<selectors.length; i++) { this.styleSheet.addRule(selectors[i], 'behavior:expression(DD_belatedPNG.fixPng(this))'); /* seems to execute the function without adding it to the stylesheet - interesting... */ } }, applyVML: function(el) { el.runtimeStyle.cssText = ''; this.vmlFill(el); this.vmlOffsets(el); this.vmlOpacity(el); if (el.isImg) { this.copyImageBorders(el); } }, attachHandlers: function(el) { var self = this; var handlers = {resize: 'vmlOffsets', move: 'vmlOffsets'}; if (el.nodeName == 'A') { var moreForAs = {mouseleave: 'handlePseudoHover', mouseenter: 'handlePseudoHover', focus: 'handlePseudoHover', blur: 'handlePseudoHover'}; for (var a in moreForAs) { handlers[a] = moreForAs[a]; } } for (var h in handlers) { el.attachEvent('on' + h, function() { self[handlers[h]](el); }); } el.attachEvent('onpropertychange', this.readPropertyChange); }, giveLayout: function(el) { el.style.zoom = 1; if (el.currentStyle.position == 'static') { el.style.position = 'relative'; } }, copyImageBorders: function(el) { var styles = {'borderStyle':true, 'borderWidth':true, 'borderColor':true}; for (var s in styles) { el.vml.color.shape.style[s] = el.currentStyle[s]; } }, vmlFill: function(el) { if (!el.currentStyle) { return; } else { var elStyle = el.currentStyle; } for (var v in el.vml) { el.vml[v].shape.style.zIndex = elStyle.zIndex; } el.runtimeStyle.backgroundColor = ''; el.runtimeStyle.backgroundImage = ''; var noColor = (elStyle.backgroundColor == 'transparent'); var noImg = true; if (elStyle.backgroundImage != 'none' || el.isImg) { if (!el.isImg) { el.vmlBg = elStyle.backgroundImage; el.vmlBg = el.vmlBg.substr(5, el.vmlBg.lastIndexOf('")')-5); } else { el.vmlBg = el.src; } var lib = this; if (!lib.imgSize[el.vmlBg]) { /* determine size of loaded image */ var img = document.createElement('img'); lib.imgSize[el.vmlBg] = img; img.className = lib.ns + '_sizeFinder'; img.runtimeStyle.cssText = 'behavior:none; position:absolute; left:-10000px; top:-10000px; border:none;'; /* make sure to set behavior to none to prevent accidental matching of the helper elements! */ img.attachEvent('onload', function() { this.width = this.offsetWidth; /* weird cache-busting requirement! */ this.height = this.offsetHeight; lib.vmlOffsets(el); }); img.src = el.vmlBg; img.removeAttribute('width'); img.removeAttribute('height'); document.body.insertBefore(img, document.body.firstChild); } el.vml.image.fill.src = el.vmlBg; noImg = false; } el.vml.image.fill.on = !noImg; el.vml.image.fill.color = 'none'; el.vml.color.shape.style.backgroundColor = elStyle.backgroundColor; el.runtimeStyle.backgroundImage = 'none'; el.runtimeStyle.backgroundColor = 'transparent'; }, /* IE can't figure out what do when the offsetLeft and the clientLeft add up to 1, and the VML ends up getting fuzzy... so we have to push/enlarge things by 1 pixel and then clip off the excess */ vmlOffsets: function(el) { var thisStyle = el.currentStyle; var size = {'W':el.clientWidth+1, 'H':el.clientHeight+1, 'w':this.imgSize[el.vmlBg].width, 'h':this.imgSize[el.vmlBg].height, 'L':el.offsetLeft, 'T':el.offsetTop, 'bLW':el.clientLeft, 'bTW':el.clientTop}; var fudge = (size.L + size.bLW == 1) ? 1 : 0; /* vml shape, left, top, width, height, origin */ var makeVisible = function(vml, l, t, w, h, o) { vml.coordsize = w+','+h; vml.coordorigin = o+','+o; vml.path = 'm0,0l'+w+',0l'+w+','+h+'l0,'+h+' xe'; vml.style.width = w + 'px'; vml.style.height = h + 'px'; vml.style.left = l + 'px'; vml.style.top = t + 'px'; }; makeVisible(el.vml.color.shape, (size.L + (el.isImg ? 0 : size.bLW)), (size.T + (el.isImg ? 0 : size.bTW)), (size.W-1), (size.H-1), 0); makeVisible(el.vml.image.shape, (size.L + size.bLW), (size.T + size.bTW), (size.W), (size.H), 1); var bg = {'X':0, 'Y':0}; var figurePercentage = function(axis, position) { var fraction = true; switch(position) { case 'left': case 'top': bg[axis] = 0; break; case 'center': bg[axis] = .5; break; case 'right': case 'bottom': bg[axis] = 1; break; default: if (position.search('%') != -1) { bg[axis] = parseInt(position)*.01; } else { fraction = false; } } var horz = (axis == 'X'); bg[axis] = Math.ceil(fraction ? ( (size[horz?'W': 'H'] * bg[axis]) - (size[horz?'w': 'h'] * bg[axis]) ) : parseInt(position)); if (bg[axis] == 0) { bg[axis]++; } }; for (var b in bg) { figurePercentage(b, thisStyle['backgroundPosition'+b]); } el.vml.image.fill.position = (bg.X/size.W) + ',' + (bg.Y/size.H); var bgR = thisStyle.backgroundRepeat; var dC = {'T':1, 'R':size.W+fudge, 'B':size.H, 'L':1+fudge}; /* these are defaults for repeat of any kind */ var altC = { 'X': {'b1': 'L', 'b2': 'R', 'd': 'W'}, 'Y': {'b1': 'T', 'b2': 'B', 'd': 'H'} }; if (bgR != 'repeat') { var c = {'T':(bg.Y), 'R':(bg.X+size.w), 'B':(bg.Y+size.h), 'L':(bg.X)}; /* these are defaults for no-repeat - clips down to the image location */ if (bgR.search('repeat-') != -1) { /* now let's revert to dC for repeat-x or repeat-y */ var v = bgR.split('repeat-')[1].toUpperCase(); c[altC[v].b1] = 1; c[altC[v].b2] = size[altC[v].d]; } if (c.B > size.H) { c.B = size.H; } el.vml.image.shape.style.clip = 'rect('+c.T+'px '+(c.R+fudge)+'px '+c.B+'px '+(c.L+fudge)+'px)'; } else { el.vml.image.shape.style.clip = 'rect('+dC.T+'px '+dC.R+'px '+dC.B+'px '+dC.L+'px)'; } }, fixPng: function(el) { el.style.behavior = 'none'; if (el.nodeName == 'BODY' || el.nodeName == 'TD' || el.nodeName == 'TR') { /* elements not supported yet */ return; } el.isImg = false; if (el.nodeName == 'IMG') { if(el.src.toLowerCase().search(/\.png$/) != -1) { el.isImg = true; el.style.visibility = 'hidden'; } else { return; } } else if (el.currentStyle.backgroundImage.toLowerCase().search('.png') == -1) { return; } var lib = DD_belatedPNG; el.vml = {color: {}, image: {}}; var els = {shape: {}, fill: {}}; for (var r in el.vml) { for (var e in els) { var nodeStr = lib.ns + ':' + e; el.vml[r][e] = document.createElement(nodeStr); } el.vml[r].shape.stroked = false; el.vml[r].shape.appendChild(el.vml[r].fill); el.parentNode.insertBefore(el.vml[r].shape, el); } el.vml.image.shape.fillcolor = 'none'; /* Don't show blank white shapeangle when waiting for image to load. */ el.vml.image.fill.type = 'tile'; /* Ze magic!! Makes image show up. */ el.vml.color.fill.on = false; /* Actually going to apply vml element's style.backgroundColor, so hide the whiteness. */ lib.attachHandlers(el); lib.giveLayout(el); lib.giveLayout(el.offsetParent); /* set up element */ lib.applyVML(el); } }; try { document.execCommand("BackgroundImageCache", false, true); /* TredoSoft Multiple IE doesn't like this, so try{} it */ } catch(r) {} DD_belatedPNG.createVmlNameSpace(); DD_belatedPNG.createVmlStyleSheet();
调用Demo:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> .png_bg a{ display:block; width:30px; height:42px; } .png_bg a:hover{ background:url(js/tab_r.png); text-indent:-2000px; } .wrap{ width:300px; height:40px; padding:30px; background:url(js/bg.jpg); } </style> <!--[if lte IE 6]> <script type="text/javascript" src="js/DD_belatedPNG_0.0.7a.js"></script> <script> DD_belatedPNG.fix('.png_bg,.png_bg a:hover'); </script> <![endif]--> </head> <body> <h3>DD_belatedPNG 脚本测试.</h3> 背景图: <div class="wrap"> <div style="background:url(js/tab_r.png);width:30px;height:42px;" class="png_bg"></div> </div> 图片: <div class="wrap"> <img src="js/tab_r.png" width="30" height="42" class="png_bg"/> </div> 超链接Hover: <div class="wrap png_bg" > <a href="#">Hover</a> </div> 背景平铺: <div class="wrap"> <div style="background:url(js/tab_r.png) repeat-x;width:200px;height:42px;" class="png_bg"></div> </div> 背景定位: <div class="wrap"> <div style="background:url(js/tab_r.png) -10px -10px;width:200px;height:42px;" class="png_bg"></div> </div> </body> </html>
发表评论
-
Jquery固定Div在页面顶部
2010-01-19 20:54 6044html: <div id="uberbar ... -
Jquery Flexigrid jsp Demo
2009-11-30 21:49 5775这是很久之前 我写给 Flexigrid作者Paulo 的 一 ... -
photoshop风格拾色器
2009-11-17 19:09 1533JavaScript仿 Photoshop 拾色器 < ... -
熟悉 js window 对象属性和方法
2009-11-07 16:56 1842熟练window对象的open、clo ... -
一个不错的js的RIA 框架组件
2009-10-11 21:01 1076一个不错的js的RIA 框架组件:http://qooxdoo ... -
文本框限制输入整数和小数
2009-09-17 22:34 1281function filterInt(evt){ evt ... -
jquery 键盘事件
2009-09-06 13:19 3484$(document).keypress(function(e ... -
JavaScript仿QQ窗口抖动算法
2009-07-12 13:47 1731JavaScript仿QQ窗口抖动算法: <img ... -
IE8使用<meta ... IE=EmulateIE7 /> 进行渲染
2009-06-27 21:24 2509目前IE8尚在测试版中,所以为了避免制作出的页面在IE8下面出 ... -
javascript提取< >中的Email地址,比如:aa<aa@163.com>;bb..
2009-06-22 10:56 3509下面是我曾经在51js上提出的问题,“客服果果”给我的解答: ... -
跨无限级iframe框架计算位置position[x, y]
2009-06-14 13:34 2837代码摘自“泽元软件-ZCMS”,作为自己学习之用: (转载请 ... -
非常不错的 Jquery Tools UI libray
2009-06-13 23:40 1422非常不错的 Jquery Tools UI libray: ... -
javascript的format格式化时间函数,类似于java的SimpleDataFormat
2009-05-30 15:37 2763Date.prototype.format = functio ... -
比较文档位置 contains() 和 compareDocumentPosition() 方法
2009-05-30 15:35 1344文章中解释了 contains() 和 compareDocu ... -
解决window.onresize事件多次调用问题
2009-05-30 15:33 6022解决window.onresize事件多次调用问题: < ... -
window.open页面中无提示关闭父窗口
2009-05-28 22:14 2102在window.open 打开的页面中加入: <sc ... -
JavaScript 内存回收散记
2009-05-18 22:28 1405xxx.innerHTML = ''; 很重要,目前来看是最 ... -
cookie 跨域访问
2009-04-16 16:09 8093正常的cookie只能在一个应用中共享,即一个cookie只能 ... -
清除浮动的最简写法
2009-04-11 21:18 1628元素浮动导致的问题及解决办法大家都应该很熟悉了,举个简单的例子 ... -
另类拖动效果
2009-03-25 10:53 961<html> <head> <t ...
相关推荐
win7修复本地系统工具
《自动化专业英语》04-Automatic-Detection-Block(自动检测模块).ppt
《计算机专业英语》chapter12-Intelligent-Transportation.ppt
内容概要:本文详细介绍了基于西门子S7-1200博图平台的3轴伺服螺丝机程序。该程序使用SCL语言编写,结合KTP700组态和TIA V14及以上版本,实现了对X、Y、Z三个轴的精密控制。文章首先概述了程序的整体架构,强调了其在自动化控制领域的高参考价值。接着深入探讨了关键代码片段,如轴初始化、运动控制以及主程序的设计思路。此外,还展示了如何通过KTP700组态实现人机交互,并分享了一些实用的操作技巧和技术细节,如状态机设计、HMI交互、异常处理等。 适用人群:从事自动化控制系统开发的技术人员,尤其是对西门子PLC编程感兴趣的工程师。 使用场景及目标:适用于希望深入了解西门子S7-1200博图平台及其SCL语言编程特点的学习者;旨在帮助读者掌握3轴伺服系统的具体实现方法,提高实际项目中的编程能力。 其他说明:文中提供的代码示例和设计理念不仅有助于理解和学习,还能直接应用于类似的实际工程项目中。
内容概要:本文详细探讨了五种非线性滤波器(卡尔曼滤波(KF)、扩展卡尔曼滤波(EKF)、无迹卡尔曼滤波(UKF)、粒子滤波(PF)和变维卡尔曼滤波(VDKF))在水下长基线定位(LBL)系统中的应用。通过对每种滤波器的具体实现进行MATLAB代码展示,分析了它们在不同条件下的优缺点。例如,KF适用于线性系统但在非线性环境中失效;EKF通过雅可比矩阵线性化处理非线性问题,但在剧烈机动时表现不佳;UKF利用sigma点处理非线性,精度较高但计算量大;PF采用蒙特卡罗方法,鲁棒性强但计算耗时;VDKF能够动态调整状态维度,适合信标数量变化的场景。 适合人群:从事水下机器人(AUV)导航研究的技术人员、研究生以及对非线性滤波感兴趣的科研工作者。 使用场景及目标:①理解各种非线性滤波器的工作原理及其在水下定位中的具体应用;②评估不同滤波器在特定条件下的性能,以便为实际项目选择合适的滤波器;③掌握MATLAB实现非线性滤波器的方法和技术。 其他说明:文中提供了详细的MATLAB代码片段,帮助读者更好地理解和实现这些滤波器。此外,还讨论了数值稳定性问题和一些实用技巧,如Cholesky分解失败的处理方法。
VMware-workstation-full-14.1.3-9474260
DeepSeek系列-提示词工程和落地场景.pdf
javaSE阶段面试题
《综合布线施工技术》第5章-综合布线工程测试.ppt
安川机器人NX100使用说明书.pdf
内容概要:本文详细介绍了将M7120型平面磨床的传统继电器控制系统升级为基于西门子S7-1200 PLC的自动化控制系统的过程。主要内容涵盖IO分配、梯形图设计和组态画面实现。通过合理的IO分配,确保了系统的可靠性和可维护性;梯形图设计实现了主控制逻辑、砂轮升降控制和报警逻辑等功能;组态画面则提供了友好的人机交互界面,便于操作和监控。此次改造显著提高了设备的自动化水平、运行效率和可靠性,降低了维护成本。 适合人群:从事工业自动化领域的工程师和技术人员,尤其是熟悉PLC编程和控制系统设计的专业人士。 使用场景及目标:适用于需要进行老旧设备升级改造的企业,旨在提高生产设备的自动化水平和可靠性,降低故障率和维护成本。具体应用场景包括但不限于金属加工行业中的平面磨床等设备的控制系统改造。 其他说明:文中还分享了一些实际调试中的经验和技巧,如急停逻辑的设计、信号抖动的处理方法等,有助于读者在类似项目中借鉴和应用。
chromedriver-linux64-136.0.7103.48.zip
IMG_20250421_180507.jpg
《网络营销策划实务》项目一-网络营销策划认知.ppt
Lianantech_Security-Vulnerabil_1744433229
MybatisCodeHelperNew2019.1-2023.1-3.4.1
【深度学习部署】基于Docker的BERT模型训练与API服务部署:实现代码复用与模型共享
摘 要 传统办法管理信息首先需要花费的时间比较多,其次数据出错率比较高,而且对错误的数据进行更改也比较困难,最后,检索数据费事费力。因此,在计算机上安装火车票订票系统软件来发挥其高效地信息处理的作用,可以规范信息管理流程,让管理工作可以系统化和程序化,同时,火车票订票系统的有效运用可以帮助管理人员准确快速地处理信息。 火车票订票系统在对开发工具的选择上也很慎重,为了便于开发实现,选择的开发工具为Eclipse,选择的数据库工具为Mysql。以此搭建开发环境实现火车票订票系统的功能。其中管理员管理用户,新闻公告。 火车票订票系统是一款运用软件开发技术设计实现的应用系统,在信息处理上可以达到快速的目的,不管是针对数据添加,数据维护和统计,以及数据查询等处理要求,火车票订票系统都可以轻松应对。 关键词:火车票订票系统;SpringBoot框架,系统分析,数据库设计
【ABB机器人】-00标准保养简介.pdf
最新校园跑腿小程序源码 多校版本,多模块,适合跑腿,外卖,表白,二手,快递等校园服务 此版本为独立版本,不需要微擎 直接放入就可以 需要自己准备好后台的服务器,已认证的小程序,备案的域名!