Skip to content

Instantly share code, notes, and snippets.

@polymorphm
Created September 27, 2011 13:41
Show Gist options
  • Save polymorphm/1245060 to your computer and use it in GitHub Desktop.
Save polymorphm/1245060 to your computer and use it in GitHub Desktop.
// -*- mode: javascript; coding: utf-8 -*-
//
// Copyright 2011 Andrej A Antonov <[email protected]>.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
(function ($) {
'use strict'
$(function () {
$('.ТУТ_ИМЯ_КЛАССА').each(function () {
$(this).css('position', 'relative')
$(this).css('z-index', '0')
$(this).css('transform', 'scale(1.0)')
$(this).hover(
function (event) {
$(this).stop()
$(this).css('z-index', '50')
$(this).animate({
transform: 'scale(2.0)',
}, 300, function () {
var site_link = $(this).data('site-link')
$(this).css('z-index', '100')
if (site_link) {
$(this).unbind('click')
$(this).click(function () {
open(site_link, '_blank')
})
$(this).css('cursor', 'pointer')
}
})
},
function (event) {
$(this).stop()
$(this).css('z-index', '50')
if ($(this).data('site-link')) {
$(this).unbind('click')
$(this).css('cursor', 'default')
}
$(this).animate({
transform: 'scale(1.0)',
}, 2000, function () {
$(this).css('z-index', '0')
})
}
)
})
})
})(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment