承接 lingo/silverstripe_respimage 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lingo/silverstripe_respimage

Composer 安装命令:

composer require lingo/silverstripe_respimage

包简介

Allows for easy use of responsive images (img.srcset) in SilverStripe

README 文档

README

Easily use responsive images in SilverStripe templates, via the HTML5 img tag's srcset attribute.

Browser compatibility for this attribute can be seen here caniuse, but in any case a polyfill is provided (use npm install) for older browsers.

See also the full documentation

Installation

Via composer

composer require lingo/silverstripe_respimage

Usage

Simply call the Responsive method on your image. You should provide a media query as an argument. See here for explanation of this attribute.

<% if $FeaturedImage %>
	$FeaturedImage.Responsive("(max-width: 800px) 93vw, 45vw")
<% end_if %>

CSS

You'll probably want to have a bit of CSS also set up to make images scale nicely, something like this:

img {
	width:  auto;
	height: 100%;
}

More information

You can also use the .BackgroundAttr method if you need to add an inline style attribute to an element, in order to use a responsive background image.

统计信息

  • 总下载量: 76
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-06-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固