Skip to content

Instantly share code, notes, and snippets.

View balazimichal's full-sized avatar

R2HC0D balazimichal

  • Bialystok, Poland
View GitHub Profile
$(document).ready(function(){
$('input').focus(function(){
$enter = $(this).val();
$(this).val('');
});
$('input').blur(function(){
$leave = $(this).val();
if($leave=='') {$(this).val($enter);}
});
@balazimichal
balazimichal / image_rotate.jquery.js
Last active December 25, 2017 20:37
jQuery image positioning after css rotation
var $img = $('.imagerotate img');
$img.on('load', function(){
var item_width = $(".pingster-gallery-item-image").width();
var image_width = $(".imagerotate img").width();
var image_height = $(".imagerotate img").height();
var scale = image_width / image_height;
var image_rotated_height = item_width * scale;