Skip to content

Instantly share code, notes, and snippets.

@oguzhanaslan
oguzhanaslan / lazyload.js
Created March 5, 2015 14:50
lazyload src change to data-original
$("img").each(function() {
$(this).attr("data-original",$(this).attr("src"));
$(this).removeAttr("src");
});
@oguzhanaslan
oguzhanaslan / scroll_opacity_decrease
Created January 15, 2015 07:51
Scroll Event Opacity Decrease
$(window).on('scroll', function() {
$('#on-load-button').css('opacity', function() {
return 1 - ($(window).scrollTop() / $(this).outerHeight());
});
});
@oguzhanaslan
oguzhanaslan / scroll.js
Created December 5, 2014 14:13
Sticky Header: Change Navigation Active Class on Page Scroll with jQuery
$(document).ready(function () {
$(document).on("scroll", onScroll);
$('a[href^="#"]').on('click', function (e) {
e.preventDefault();
$(document).off("scroll");
$('a').each(function () {
$(this).removeClass('active');
})
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@oguzhanaslan
oguzhanaslan / Disable-Scrolling.js
Created October 25, 2014 07:51
Disable Scrolling
function disableScrolling(){
$(document).bind("scroll",function(e){
$('html, body').animate({scrollTop : 0},200);
});
}
@oguzhanaslan
oguzhanaslan / stop-image-to-copy.js
Created October 25, 2014 07:50
Stop Visitors Dragging Images To Copy
function stopImageDrag(){
$("img").bind("dragstart",function(e){
return false;
});
}
@oguzhanaslan
oguzhanaslan / copy-url.js
Created October 25, 2014 07:49
Copy Your URL To Visitors Clipboard Only IE
function copyUrlToClipboard(){
var url = location.href;
window.clipboardData.setData('url',url);
}
@oguzhanaslan
oguzhanaslan / strong-password.js
Created October 25, 2014 07:46
Strong Password
$(document).ready(function() {
$('#passwordInput, #confirmPasswordInput').on('keyup', function(e) {
if($('#passwordInput').val() == '' && $('#confirmPasswordInput').val() == '')
{
$('#passwordStrength').removeClass().html('');
return false;
}
@oguzhanaslan
oguzhanaslan / smooth-scrolling.js
Created October 25, 2014 07:42
Smooth Scrolling
$('a[href^="#"]').on('click',function (e) {
e.preventDefault();
var target = this.hash;
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 900, 'swing', function () {
@oguzhanaslan
oguzhanaslan / logoeffect
Created June 11, 2014 18:07
logoeffect.js
var radius = 0;
var interval = window.setInterval(function() {
$(".logo a").css({
"-webkit-mask": "-webkit-gradient(radial, 17 17, " + radius + ", 17 17, " + (radius + 15) + ", from(rgb(0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, .2)), to(rgb(0, 0, 0)))",
"-o-mask": "-webkit-gradient(radial, 17 17, " + radius + ", 17 17, " + (radius + 15) + ", from(rgb(0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, .2)), to(rgb(0, 0, 0)))",
"-moz-mask": "-webkit-gradient(radial, 17 17, " + radius + ", 17 17, " + (radius + 15) + ", from(rgb(0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, .2)), to(rgb(0, 0, 0)))",
"mask": "-webkit-gradient(radial, 17 17, " + radius + ", 17 17, " + (radius + 15) + ", from(rgb(0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, .2)), to(rgb(0, 0, 0)))"
});
radius++;