Public/BJUI/js/bjui-slidebar.js
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*!
* B-JUI v1.0 (http://b-jui.com)
* Git@OSC (http://git.oschina.net/xknaan/B-JUI)
* Copyright 2014 K'naan (xknaan@163.com).
* Licensed under Apache (http://www.apache.org/licenses/LICENSE-2.0)
*/
/* ========================================================================
* B-JUI: bjui-slidebar.js v1.0
* @author K'naan (xknaan@163.com)
* -- Modified from dwz.barDrag.js (author:Roger Wu)
* http://git.oschina.net/xknaan/B-JUI/blob/master/BJUI/js/bjui-slidebar.js
* ========================================================================
* Copyright 2014 K'naan.
* Licensed under Apache (http://www.apache.org/licenses/LICENSE-2.0)
* ======================================================================== */
+function ($) {
'use strict';
// SLIDEBAR CLASS INSTANCE
// ======================
$(function() {
$('body').append('<!-- Adjust the width of Left slide -->').append(FRAG.splitBar).append(FRAG.splitBarProxy)
$('#bjui-leftside').slidebar({minW:150, maxW:700})
})
// SLIDEBAR CLASS DEFINITION
// ======================
var Slidebar = function(element, options) {
this.$element = $(element)
this.$bar = this.$element.find('#bjui-sidebar')
this.$sbar = this.$element.find('#bjui-sidebar-s')
this.$toggle = this.$bar.find('.toggleCollapse div')
this.$stoggle = this.$sbar.find('.toggleCollapse div')
this.$collapse = this.$sbar.find('.collapse')
this.$split = $('#bjui-splitBar')
this.$split2 = $('#bjui-splitBarProxy')
this.$container = $('#bjui-container')
this.options = options
}
Slidebar.prototype.hide = function() {
this.$toggle.trigger('click')
}
Slidebar.prototype.init = function() {
var that = this
this.$toggle.click(function() {
that.$split.hide()
BJUI.ui.showSlidebar = false
var sbarwidth = parseInt(that.$sbar.css('left')) + that.$sbar.outerWidth()
var barleft = sbarwidth - that.$bar.outerWidth()
var cleft = parseInt(that.$container.css('left')) - (that.$bar.outerWidth() - that.$sbar.outerWidth())
var cwidth = that.$bar.outerWidth() - that.$sbar.outerWidth() + that.$container.outerWidth()
后面还有 116 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。