Skip to content

Instantly share code, notes, and snippets.

View hayatbiralem's full-sized avatar

Ömür Yanıkoğlu hayatbiralem

View GitHub Profile
@hayatbiralem
hayatbiralem / jquery-notification-bar-with-cookie.js
Last active August 29, 2015 13:57
jQuery top notification bar with javascript cookies.
@hayatbiralem
hayatbiralem / add-remove-class-on-event.js
Created April 16, 2014 13:04
Add/Remove class on event helpers
// add/remove class on event helpers
Helper.addClassOnEvent = function(el, ev, cl){
var $el = $(el);
if(!$el.length || !cl || typeof ev !== "string" || typeof cl !== "string") {
return false;
}
$el.each(function(){
// if(!Modernizr.hasEvent(ev, this)){
// return true;
@hayatbiralem
hayatbiralem / make-class-list-for-collection.scss
Created April 17, 2014 12:55
Make class list for collection in Sass
$facebook-color : hsla(222, 47%, 40%, 1); // #365397
$twitter-color : hsla(198, 100%, 47%, 1); // #00a9f1
$linkedin-color : hsla(203, 100%, 35%, 1); // #006db3
social-platforms: facebook $facebook-color,
twitter $twitter-color,
linkedin $linkedin-color;
@mixin make-class-list-for-collection($collection, $index: 1, $prefix: "") {
$list: "";
git config --global alias.sync-gh-pages '!git push && git checkout gh-pages && git merge master && git push && git checkout master'
@hayatbiralem
hayatbiralem / imagesLoaded.js
Last active November 26, 2015 15:32
Images loaded function without imagesLoaded library
(function($){
var imagesLoaded = function(selector, onComplete, onProgress) {
var $images = $(selector).find('img');
var success = 0;
var error = 0;
var iteration = 0;
var total = $images.length;
var check = function(el, status) {
iteration++;
var data = {
@hayatbiralem
hayatbiralem / blue_gradient_background.css
Created March 8, 2013 15:06
A simple css class for responsive button.
/*
Generated by http://www.colorzilla.com/gradient-editor
Colors: #008FCA, #33B2E6
*/
.blue_gradient_background {
background: #33b2e6; /* Old browsers */
background: -moz-linear-gradient(top, #33b2e6 0%, #008fca 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#33b2e6), color-stop(100%,#008fca)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #33b2e6 0%,#008fca 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #33b2e6 0%,#008fca 100%); /* Opera 11.10+ */
@hayatbiralem
hayatbiralem / check_background_image_is_loaded.js
Last active December 14, 2015 16:59
How can I check if a background image is loaded?
// Source: http://stackoverflow.com/questions/5057990/how-can-i-check-if-a-background-image-is-loaded
$('<img/>').attr('src', 'http://picture.de/image.png').load(function() {
$('body').css('background-image', 'url(http://picture.de/image.png)');
});
@hayatbiralem
hayatbiralem / TabbedCarouFredSel.js
Last active December 15, 2015 08:29
Just a simple solution for refresh CarouFredSel dimensions after tabs changed...
$(".tab_content").hide();
$(".tab_content:first").show();
$("ul.tablar li").click(function () {
$("ul.tablar li").removeClass("active");
$(this).addClass("active");
$(".tab_content").hide();
var index = $("ul.tablar li").index(this);
// $('.tab_content').eq(index).fadeIn(500);
@hayatbiralem
hayatbiralem / jquery-not-first-child.js
Created July 25, 2013 10:13
[jQuery] Selecting all but first-child
// Source: http://forum.jquery.com/topic/jquery-selecting-all-but-first-child
// Most easy to understand, get all li elements except for the first one.
$("li:not(:first-child)")
// Get all li elements and slice off the first
$("li").slice(1)
// Get all li elements that are prepended by an li
$('ul li+li')
<select id="state" class="pure-input-medium" onchange="window.location='../'+this.options[this.selectedIndex].value+'/';">
<option value="en">English</option>
<option value="es">Español</option>
<option value="de">Deutsch</option>
</select>