cryogen-bootstrap/themes/bootstrap4/social-spike/social/assets/js/docs.js

20 lines
809 B
JavaScript
Raw Normal View History

2019-11-23 11:45:04 +00:00
$(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();
});