cryogen-bootstrap/themes/bootstrap4/social-spike/social/assets/js/docs.js
2019-11-23 12:45:04 +01:00

19 lines
809 B
JavaScript

$(function () {
var all_classes = "";
var timer = undefined;
$.each($('li', '.social-class'), function (index, element) {
all_classes += " btn-" + $(element).data("code");
});
$('li', '.social-class').mouseenter(function () {
var icon_name = $(this).data("code");
if ($(this).data("icon")) {
icon_name = $(this).data("icon");
}
var icon = "<i class='fab fa-" + icon_name + "'></i>";
$('.btn-social', '.social-sizes').html(icon + "Sign in with " + $(this).data("name"));
$('.btn-social-icon', '.social-sizes').html(icon);
$('.btn', '.social-sizes').removeClass(all_classes);
$('.btn', '.social-sizes').addClass("btn-" + $(this).data('code'));
});
$($('li', '.social-class')[Math.floor($('li', '.social-class').length * Math.random())]).mouseenter();
});