cakebake/jquery-breakpoint-check
Composer 安装命令:
composer require cakebake/jquery-breakpoint-check
包简介
Check the current visibility of bootstrap 3 breakpoints
README 文档
README
Check the current visibility of bootstrap 3 breakpoints.
Why another breakpoint check for bootstrap 3?
The plugin I have created for simple reasons:
- I needed something that works and is easy to integrate into existing projects (in my daily work)
- I did not want to create a new code in each project. A plugin repository is mostly stable
- Bootstrap did not provide its own Javascript API for this
- I had fun doing it^^
Installation
You can download the plugin manually or install by composer. ... and the plugin requires jQuery. ;) jQuery must be properly integrated into the page.
Install via Composer (recommended for php projects)
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install the package using the following command:
php composer.phar require --prefer-dist cakebake/jquery-breakpoint-check "*"
or add
"cakebake/jquery-breakpoint-check": "*"
to the require section of your composer.json file and run php composer.phar update.
Manual Installation
Download:
Include one of the two javascript files from the folder js after jQuery include. For productive projects, you can use the jquery-breakpoint-check.min.js version. For more details see file test.html.
Example:
<script src="js/jquery-breakpoint-check.min.js"></script>
Usage
Is the current screen resolution xs breakpoint?
if ($.isXs()) { alert('Is xs breakpoint :)'); }
Is the current screen resolution sm breakpoint?
if ($.isSm()) { alert('Is sm breakpoint :)'); }
Is the current screen resolution md breakpoint?
if ($.isMd()) { alert('Is md :)'); }
Is the current screen resolution lg breakpoint?
if ($.isLg()) { alert('Is lg breakpoint :)'); }
Is the current screen resolution custom breakpoint?
Create a CSS-Class with visibility for your custom breakpoint. For example:
.visible-grid-float-breakpoint {
@media (min-width: @grid-float-breakpoint-max) {
display: none;
visibility: hidden;
}
}
if ($.isBreakpoint('grid-float-breakpoint')) { alert('It is my custom breakpoint :)'); }
Check the current breakpoint on screen resize.
$(window).resize(function () { if ($.isXs()) { alert('Is xs breakpoint :)'); } else if ($.isSm()) { alert('Is sm breakpoint :)'); } else if ($.isMd()) { alert('Is md :)'); } else if ($.isLg()) { alert('Is lg breakpoint :)'); } }).resize();
Hide a div on xs and lg breakpoint.
$(window).resize(function () { var selector = $("div.selector"); if ($.isXs() || $.isLg()) { selector.hide(); } else { selector.hide(); } }).resize();
Copyright and License
Copyright (C) Jens A. (cakebake)
Released under the MIT license
cakebake/jquery-breakpoint-check 适用场景与选型建议
cakebake/jquery-breakpoint-check 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 46 次下载、GitHub Stars 达 11, 最近一次更新时间为 2015 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「jquery」 「javascript」 「bootstrap」 「responsive」 「breakpoint」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cakebake/jquery-breakpoint-check 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cakebake/jquery-breakpoint-check 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cakebake/jquery-breakpoint-check 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Views for the package MedicOneSystems Livewire Datatables with Bootstrap 4
PHP client for the Google Closure Compiler API in one file.
统计信息
- 总下载量: 46
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-06