我正在使用从CodePen中找到的以下代码...我在JS很糟糕,我希望有人可以帮助我.
这是我在HTML部分中的代码
<div id="SlideMiddle">
<div id="grid">
<div id="grid-content"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是javascript
<script>
var Imgs = [
'https://tympanus.net/Development/GridLoadingEffects/images/1.jpg',
'https://tympanus.net/Development/GridLoadingEffects/images/3.jpg',
'https://d13yacurqjgara.cloudfront.net/users/64706/screenshots/1167254/attachments/152315/SUGARSKULL-01.png',
'https://tympanus.net/Development/GridLoadingEffects/images/8.jpg',
'https://tympanus.net/Development/GridLoadingEffects/images/10.png',
'https://tympanus.net/Development/GridLoadingEffects/images/14.png',
'https://tympanus.net/Development/GridLoadingEffects/images/9.jpg',
'https://tympanus.net/Development/GridLoadingEffects/images/13.png',
'https://tympanus.net/Development/GridLoadingEffects/images/12.png',
'https://tympanus.net/Development/GridLoadingEffects/images/4.jpg',
'http://www.thedrum.com/uploads/news/172673/DzrMPF_DeezerPoster_MusicSoundBetterWithYou_03.jpg'
];
$(document).ready(function(){
$grid = $('#grid-content');
$.fn.revealItems = function($items){
var iso = this.data('isotope');
var itemSelector = iso.options.itemSelector;
$items.hide();
$(this).append($items);
$items.imagesLoaded().progress(function(imgLoad, image){
var $item = $(image.img).parents(itemSelector);
$item.show();
iso.appended($item);
});
return this;
}
$grid.isotope({
containerStyle: null,
masonry:{
columnWidth: 300,
gutter: 15
},
itemSelector: '.grid-item',
filter : '*',
transitionDuration: '0.4s'
});
$grid.imagesLoaded().progress(function(){
$grid.isotope();
})
function …Run Code Online (Sandbox Code Playgroud) 我现在正在为我的一个项目使用Git,我喜欢它.
但是,因为我是唯一一个在我的项目上工作的人,所以我用过的唯一命令就是
git status
git add .
git commit -m 'message here'
git push origin master
Run Code Online (Sandbox Code Playgroud)
我很久以前就已将项目推向远程(我使用Capistrano进行部署),一切都很顺利.
现在我想改变网站的设计,但保持逻辑不变.我猜我需要创建一个新分支(让我们称之为newdesign).
我想知道的是:如果我正在newdesign分支机构工作,并且我在分支中看到了一个错误,master我怎么能修复bug master然后将该bugfix集成到newdesign分支中,以便后者成为与实际逻辑保持同步?
我正在将 Laravel 4 用于我正在进行的项目。它的许多功能严重依赖 AJAX。
在我用来上传文件(fileupload)的jQuery中,我有以下成功和失败函数:
done: function (e, data) {
// Show success message
},
fail: function (e, data) {
// Show fail message
}
Run Code Online (Sandbox Code Playgroud)
在我的控制器中,我使用以下命令返回成功或失败:
// Success Response
return Response::json('success', 200)
// Fail Response
return Response::json('error', 400)
Run Code Online (Sandbox Code Playgroud)
功能一切正常,成功和失败消息显示,文件上传,一切都很完美,除了函数失败并返回失败响应时,在控制台中我看到:
400 (Bad Request)
Run Code Online (Sandbox Code Playgroud)
错误消息仍然显示并且一切都很好,但我只是想知道我是否正确处理了这个问题,我不喜欢控制台中显示红色错误,因为某些似乎工作正常的东西。
任何建议将不胜感激。
我在项目开始时进行了迁移,基本上添加了一个名为“描述”的 TEXT 列,该列设置为 NOT NULL。
现在几个月后,我需要更改它以允许空值。
我不能使用 Laravel 5.5 change() 函数,因为我的列列表中有一个枚举并且它出错了,所以我需要在这样的迁移中将它添加为原始查询;
DB::statement('ALTER TABLE `galleries` MODIFY `description` TEXT NULL;');
Run Code Online (Sandbox Code Playgroud)
当我对我的本地 mysql 数据库执行 php artisan 迁移时,一切都很好,但是当我尝试运行我的测试套件时,一切都中断了。
我在我的测试套件中使用 SQLite,我得到的错误如下;
PDOException: SQLSTATE[HY000]: General error: 1 near "MODIFY": syntax error
Run Code Online (Sandbox Code Playgroud)
如果其他人遇到了这个问题并解决了它,我很想听听你是如何做到的。
谢谢