Last active
October 16, 2015 14:14
-
-
Save xhoskin/aa0e1caceaa6356f79a6 to your computer and use it in GitHub Desktop.
Синхронное подсвечивание одинковых ссылок при наведении hover (например наводим на подпись - подсвечивается еще и картинка
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
// Синхронное подсвечивание одинковых ссылок при наведении hover | |
// (например наводим на подпись - подсвечивается еще и картинка | |
var addDoubleHovers = (function() { | |
return $('a[href].js-dh').hover(function() { | |
var href; | |
href = $(this).attr('href'); | |
return $('a[href="' + href + '"]').addClass('js-hover'); | |
}, function(){ | |
var href; | |
href = $(this).attr('href'); | |
return $('a[href="' + href + '"]').removeClass('js-hover'); | |
}); | |
})(); | |
// на нужные ссылки добавить класс .js-dh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment