惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
AWS News Blog
AWS News Blog
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Security @ Cisco Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
Attack and Defense Labs
Attack and Defense Labs
Jina AI
Jina AI
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
H
Help Net Security
V
Visual Studio Blog
宝玉的分享
宝玉的分享
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threat Research - Cisco Blogs
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
Latest news
Latest news
T
Tor Project blog
I
Intezer
美团技术团队
GbyAI
GbyAI
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 三生石上(FineUI控件)
Google DeepMind News
Google DeepMind News
Scott Helme
Scott Helme
Y
Y Combinator Blog
博客园 - 司徒正美
T
Tenable Blog
O
OpenAI News
N
News and Events Feed by Topic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V
Vulnerabilities – Threatpost
P
Palo Alto Networks Blog
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threatpost
Google Online Security Blog
Google Online Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
Help Net Security
Help Net Security

博客园 - 站在天空下的猪

SqlBulkCopy批量转移数据备注 根据文本框联动下拉框(jquery 插件) - 站在天空下的猪 - 博客园 关于用FOMR提交编码的问题 自己写的一个jquery模板引擎(json比较好用) Document 对象的常用方法 今天发现梅花雨日历控件蛮好用的哟,腾讯都在用 身份证对应县及县的行政区划代码 【SQLSERVER】存储过程基础 终于解决了一个AjaxPro无刷新的问题了,可以引用在短信方面滴asp.net 2.0 昨天很失败 一个简单的FileUpload处理逻辑 C# 判断是否为数字 DataBinder.Eval总结 asp.net 2.0中实现防盗链 如何把HTML语句直接保存到数据库 如何取得IP/用户名等信息 “ConnectionString 属性尚未初始化”的另类解决办法 asp.net常用函数表 C#中计算两个时间的差
jquery 图片预览插件 - 站在天空下的猪 - 博客园
站在天空下的猪 · 2009-05-25 · via 博客园 - 站在天空下的猪

写着玩的,哎,每次写的东西都不是那么完美,算了,当学习

效果图:

//图片预览插件
//Writer:lyfeixue
//2009-5-25 11:29:17
//参数:options json对象,w:显示的宽度,h:显示的高度,如果高度或者宽度为空,则调用原始的图片大小
//调用方法 $("#VenLogo").PicturePreview();
//$("#VenLogo").PicturePreview(w:0,h:0);默认显示图片的原始高宽

//$("#VenLogo").PicturePreview(w:300,h:300);自定义显示出来的图片高宽
//bug:只能调用第一个对象的图片URL,如果传入了多个jquery对象,有待解决
(function($) {
    $.fn.PicturePreview = function(options) {
        var o = $.extend({
            w: 200,
            h: 200
        }, options);
        var _this = this;
        var allowExt = ["jpg", "png", "bmp", "gif"]; //定义允许的图片参数
        var isCheck = false; //是否校验通过图片
        _this.mousemove(function(e) {
            var FileUrl = _this.val();
            if (FileUrl == "" || FileUrl == null) { FileUrl = _this.html() == "" || _this.html() == null ? _this.text() : _this.html(); }
            var arrList = FileUrl.split(".");
            isCheck = new RegExp(allowExt.join("\|"), "ig").test(arrList[arrList.length - 1]);
            if (isCheck) {
                var obj = $("#Ly_PicturePreview");
                if (obj.size() == 0) {
                    //创建预览对象
                    $("body").append("<img id=\"Ly_PicturePreview\" alt=\"图片预览\" style=\"border:1px solid gray;position:absolute;display:none;z-index:999;\" src=\"" + FileUrl + "\" />");
                }
                else {
                    obj.attr("src", FileUrl);
                }
                obj.css({ top: e.pageY + 5, left: e.pageX + 5, width: o.w == 0 ? obj.width() : o.w, height: o.h == 0 ? obj.height() : o.h }).show();
            }
        }).mouseout(function() {
            $("#Ly_PicturePreview").hide();
        });
        return _this;
    };
})(jQuery);