colorbox 弹出层 jquery


  • $(".inline").colorbox({inline:true, width:"50%"});
    <p><a class='inline' href="#inline_content">Inline HTML</a></p>
    <div style='display:none'>
    <div id='inline_content' style='padding:10px; background:#fff;'>
    <p><strong>This content comes from a hidden element on this page.</strong></p>
    <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
    </div>
    </div>



    在上面的代码中,每种使用方式都有说明,从代码中可以看出, colorbox 使用起来是非常的简单。

    colorbox 还提供了很多的属性、方法和事件,可以让我们更加方式的就用 colorbox,下面是一个从网上找的一个中文的参考列表:

    KEY

    设置的值

    DEFAULT

    默认值

    DESCRIPTION

    介绍

    transition

    “elastic”

    The transition type. Can be set to “elastic”, “fade”, or “none”.

    过渡效果,可以是”elastic”, “fade”, or “none”.

    speed

    350

    Sets the speed of the fade and elastic transitions, in milliseconds.

    设置过渡效果的持续时间,毫秒

    href

    false

    This can be used as an alternative anchor URL or to associate a URL for non-anchor elements such as images or form buttons. Example:

    $(‘h1′).colorbox({href:”welcome.html”})

    这个用来设置一个锚标记的值或者一个不是锚的元素,例如图像或者表单的按钮,例如:

    title

    false

    This can be used as an anchor title alternative for ColorBox.

    这可以为Colorbox设置一个标题

    rel

    false

    This can be used as an anchor rel alternative for ColorBox. This allows the user to group any combination of elements together for a gallery, or to override an existing rel so elements are not grouped together. Example:

    $(‘#example a’).colorbox({rel:’group1′})

    这个可以根据元素的rel属性设置要显示的元素集合,也可以覆盖一个存在的rel属性

    width

    false

    Set a fixed total width. This includes borders and buttons. Example: “100%”, “500px”, or 500

    设置宽度,包括边框和按钮

    height

    false

    Set a fixed total height. This includes borders and buttons. Example: “100%”, “500px”, or 500

    设置高度,包括边框和按钮

    innerWidth

    false

    This is an alternative to ‘width’ used to set a fixed inner width. This excludes borders and buttons. Example: “50%”, “500px”, or 500

    这个可以设定一个固定的内大小,包括边框和按钮

    innerHeight

    false

    This is an alternative to ‘height’ used to set a fixed inner height. This excludes borders and buttons. Example: “50%”, “500px”, or 500

    这个可以设定一个固定的内高度,包括边框和按钮

    initialWidth

    300

    Set the initial width, prior to any content being loaded.

    设置初始化宽度

    initialHeight

    100

    Set the initial height, prior to any content being loaded.

    设置初始化高度

    maxWidth

    false

    Set a maximum width for loaded content. Example: “100%”, 500, “500px”

    设置内容的最大宽度

    maxHeight

    false

    Set a maximum height for loaded content. Example: “100%”, 500, “500px”

    设置内容的最大高度

    scalePhotos

    true

    If ‘true’ and if maxWidth, maxHeight, innerWidth, innerHeight, width, or height have been defined, ColorBox will scale photos to fit within the those values.

    如果是true且maxWidth, maxHeight, in

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值