Kevin Cheng's Yard
电脑是我的老婆,编程是我的灵魂,代码是我的语言,按键是我在歌唱。
随笔- 54  文章- 0  评论- 249 
博客园  首页  新随笔  联系  管理  订阅 订阅
2010年6月28日
我写的第一个jquery插件:jquery.photoFrame(version 0.2)

先看效果

 

introduce
    jQuery photoframe plugin
    A useful plugin to beautify image or text by wrapping target with image frame
    Copyright (c) 2010 surfsky
    Free to use but don't modify this notation
    @author: surfsky.cnblogs.com
    @version: 0.2
    @lastupdate:  2010-06-30
    jquery.photoFrame是很方便的一个相框插件,原理也很简单,将选定对象用九宫格table包裹,再设置其边框的背景图片即可。以上三种样式都是用photoframe实现的,我会继续丰富其样式,目标是拿来即用,简化页面代码。此代码可以任意使用,但转载请注明出处:http://surfsky.cnblogs.com/


what's new
    v0.2 支持skin,同一页面支持多种样式同时存在
         新增样式 deepShadow

         修改内嵌image在ie6下会留白的bug
    v0.1 新建,实现基本功能

usage
    <link type="text/css" rel="stylesheet" href="shadow/style.css" />
    <link type="text/css" rel="stylesheet" href="deepshadow/style.css" />
    <link type="text/css" rel="stylesheet" href="stamp/style.css" />
    <link type="text/css" rel="stylesheet" href="topbanner/style.css" />
    <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="jquery.photoFrame.js"></script>
    <script type="text/javascript">
      $(function(){
        $("#target1").photoFrame();
        $("#target2").photoFrame({skin:'shadow', direction:'bottomRight'});
        $("#target3").photoFrame({skin:'deepshadow', direction:'bottomRight'});
        $("#target4").photoFrame({skin:'stamp', direction:'all'});
        $("#target5").photoFrame({skin:'topbanner', direction:'top'});
      });
    </script>
    <div id="target1">
      <img src="images/1.jpg" />
    </div>
    <div id="target2">
      <img src="images/2.jpg" />
    </div>
    <div id="target3">
      <img src="images/3.jpg" />
    </div>
    <div id="target4">
      <img src="images/4.jpg" />
    </div>
    <div id="target5">
      <h2>this is title</h2>
      thfjsjfkljslfjsjfldsjflkjdslkfjdslkjflskjfljslfjslfkjsfkjdslfjsdljklsjfjdslkfjsdlkfjslkjflkdsjflkdsjfkdsjlkjfslkds
    </div>

 

parameters
    skin(皮肤名称):
        'shadow', 'deepshadow', 'stamp', 'topbanner'
    direction(画框方向):
        'top', 'bottom', 'left', 'right'
        'topLeft', 'topRight', 'bottomLeft', 'bottomRight'


skin
    shadow: 阴影效果
    deepShadow: 加深阴影效果
    topBanner: 顶部banner效果
    stamp: 邮票效果
    cloud: 云朵包围效果(未实现)
    teal: 撕纸效果(未实现)

extense skin (扩展样式)
    拷贝skin目录,拷贝图片并修改css就可以了
    .myskin .tl {background:url(tl.gif) no-repeat; width:5px; height:5px;}
    .myskin .t  {background:url(t.gif)  repeat-x;  height:5px;}
    .myskin .tr {background:url(tr.gif) no-repeat; width:5px; height:5px;}
    .myskin .l  {background:url(l.gif)  repeat-y;  width:5px;}
    .myskin .r  {background:url(r.gif)  repeat-y;  width:5px;}
    .myskin .b  {background:url(b.gif)  repeat-x;  height:5px;}
    .myskin .bl {background:url(bl.gif) no-repeat; width:5px; height:5px;}
    .myskin .br {background:url(br.gif) no-repeat; width:5px; height:5px;}
    .myskin .m  {border:solid black 1px; padding-bottom:-5px; margin-bottom:-10px;}
    .myskin img {display:block;}

 

下载:

    0.1 /Files/surfsky/jquery.photoFrame.rar
    0.2 /Files/surfsky/jquery.photoFrame.0.2.rar

posted @ 2010-06-28 12:49 Kevin Cheng 阅读(1965) 评论(5) 编辑
Copyright ©2012 Kevin Cheng
精于斯,乐于斯。
昵称:Kevin Cheng
园龄:6年3个月
粉丝:20
关注:1
<2010年6月>
日一二三四五六
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

搜索

 
 

常用链接

  • 我的随笔
  • 我的评论
  • 我的参与
  • 最新评论
  • 我的标签
  • 更多链接

我的标签

  • Rss RssItem RssChannel XmlSerializer(1)
  • MVC ASP.NET Razor(1)
  • MVC Razor ASP.NET(1)
  • MVC ASP.NET(1)
  • javascript oo 类 对象 命名空间(1)
  • ASP.NET MVC SKIN 换肤(1)
  • Silverlight WPF(1)

随笔分类

  • 日子(3)
  • .NET(14)
  • .NET组件控件(15)
  • IT新闻(1)
  • 报表开发(1)
  • 代码生成器(1)
  • 工作流引擎
  • 建模与快速开发 (5)
  • 数据库 (4)
  • 杂项(7)

随笔档案

  • 2010年12月 (1)
  • 2010年11月 (1)
  • 2010年10月 (6)
  • 2010年8月 (7)
  • 2010年6月 (3)
  • 2009年12月 (1)
  • 2009年11月 (2)
  • 2009年5月 (2)
  • 2008年12月 (1)
  • 2008年8月 (1)
  • 2008年7月 (1)
  • 2007年12月 (1)
  • 2007年6月 (1)
  • 2007年5月 (1)
  • 2007年3月 (2)
  • 2007年1月 (1)
  • 2006年12月 (1)
  • 2006年11月 (1)
  • 2006年10月 (1)
  • 2006年9月 (1)
  • 2006年8月 (3)
  • 2006年6月 (5)
  • 2006年3月 (2)
  • 2006年2月 (1)
  • 2005年12月 (7)

文章分类

  • .NET(1)

相册

  • 回忆

Blogs

  • DbToCode
  • RapidTier
  • SmartPersistenceLayer
  • 灵感之源

NET WebSite

  • ASP.NET
  • CodeProject
  • CSDN
  • GoDotNet
  • MSDN
  • SourceForge

Special

  • icsharpcode.com
  • Open License
  • Python

最新评论

阅读排行榜

评论排行榜

推荐排行榜