This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function restrictString(str, restrict) { | |
postTxt = '...'; | |
if ( str.length > restrict ) str = str.substr(0, restrict) + postTxt; | |
return str; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
restrictRow('.restrict-row', 3, '...'); | |
function restrictRow(elm, row, postfix_arg) { | |
var target = { | |
$elm : $(elm), | |
html : $(elm).html() | |
}, | |
clone = { | |
$elm : target.$elm.clone(), | |
height : 0 | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getUserFeed(function(feed) { | |
for ( var i = 0; i < feed.length; i++ ) { | |
var obj = feed[i]; | |
var text = restrictString(obj.text, 20); | |
var html = '<section class="fb-feed">'; | |
html += '<a href="' + obj.link + '" target="_blank">'; | |
if ( obj.src ) html += '<p class="fb-thumb"><img src="' + obj.src + '"></p>'; | |
html += '<p class="fb-text">' + text + '</p>'; | |
html += '<p class="fb-date">' + obj.date + '</p>'; | |
html += '</a>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function changeImage(){ | |
var pcSuffix = '_pc', | |
spSuffix = '_sp', | |
breakPoint = 480; | |
$('.resimg').each(function(){ | |
var $img = $(this); | |
if ( window.innerWidth < breakPoint ) { | |
$img.attr('src',$img.attr('src').replace(pcSuffix,spSuffix)); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function() { | |
$('a[href^=#]').on('click', function() { | |
var href = $(this).attr("href"), | |
target = $(href === "#" || href === "" ? 'html' : href), | |
position = target.offset().top; | |
$('body,html').animate({scrollTop:position}, 400, 'swing'); | |
return false; | |
}); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function() { | |
var array = [39, 52, 110, 9, 8, 32]; | |
console.log(array); | |
//数値の昇順ソート | |
console.log(array.sort(function(a, b){return a-b;})); | |
//数値の降順ソート | |
console.log(array.sort(function(a, b){return b-a;})); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function() { | |
var arr = [ | |
{ | |
'name': 'kimura', | |
'value': 56 | |
}, | |
{ | |
'name': 'kaela', | |
'value': 2 | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function() { | |
var obj = []; | |
obj.push({'name': 'kimura', 'value': 56}); | |
obj.push({'name': 'kaela', 'value': 2}); | |
obj.push({'name': 'rie', 'value': 13}); | |
for ( var i = 0; i < obj.length; i++ ) { | |
for ( var key in obj[i] ) { | |
console.log(key + ' : ' + obj[i][key]); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$2" = "" ]; then | |
git archive --format=zip --prefix=archive/ HEAD `git diff --name-only HEAD $1` | tar xf - -C ~/Downloads/ | |
else | |
git archive --format=zip --prefix=archive/ $1 `git diff --name-only $1 $2` | tar xf - -C ~/Downloads/ | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir 01_資料 | |
mkdir 02_デザイン | |
mkdir 03_素材 | |
mkdir 04_HTML | |
mkdir 05_納品データ |
OlderNewer