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
window.onload = function() { | |
var placeholder = $('.placeholder'); | |
placeholder.each( function(index) { | |
// 1: load small image and show it | |
var smallImgElement = $(this).find('.img-small'); | |
console.log(smallImgElement); | |
var img = new Image(); | |
img.src = smallImgElement.attr('src'); |
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
// When the page starts loading | |
var timerStart = Date.now(); | |
// Executes when complete page is fully loaded, including all frames, objects and images | |
$(window).load(function () {}) | |
loadTime = (Date.now() - timerStart) / 1000; | |
$('#page_load').html(loadTime + ' s'); | |
}); |
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
$(“#tags”).tagit({ | |
availableTags: [‘ruby’, ‘rails’,’range’, ‘ready’], | |
tagLimit: 2, | |
beforeTagAdded: function(event, ui){ | |
// Do something special as you want | |
} | |
afterTagAdded: function(event, ui){ | |
// Do something special as you want | |
} | |
beforeTagRemoved: function(event, ui){ |
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
$(“#tags”).tagit({ | |
availableTags: [‘ruby’, ‘rails’,’range’, ‘ready’], | |
tagLimit: 2, | |
onTagLimitExceeded: function(event, ui){ | |
alert('You cannot add more than 2 tags!') | |
} | |
}); |
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
$(“#tags”).tagit({ | |
availableTags: [‘ruby’, ‘rails’,’range’, ‘ready’], | |
tagLimit: 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
<ul id="tags"> | |
<li>My Tag 1</li> | |
<li>My Tag 2</li> | |
</ul> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$("#tags").tagit(); | |
}); | |
</script> |
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
//= require jquery-ui | |
//= require tag-it |
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
*= require jquery-ui | |
*= require jquery-ui.structure | |
*= require jquery-ui.theme | |
*= require jquery.tagit |
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
/*! | |
* jQuery UI CSS Framework 1.12.0 | |
* http://jqueryui.com | |
* | |
* Copyright jQuery Foundation and other contributors | |
* Released under the MIT license. | |
* http://jquery.org/license | |
* | |
* http://api.jqueryui.com/category/theming/ | |
* |