Browse Source

footnote popups

dependabot/npm_and_yarn/acorn-5.7.4
rdrew 6 years ago
parent
commit
e550959a09
  1. 26
      css/style.css
  2. 18
      js/js.js
  3. 18
      src/js/js.js
  4. 26
      src/scss/_tooltips.scss
  5. 1
      src/scss/style.scss

26
css/style.css

File diff suppressed because one or more lines are too long

18
js/js.js

@ -1,14 +1,14 @@
(function ($, Drupal) { (function ($, Drupal) {
Drupal.behaviors.footnote_tooltips = { Drupal.behaviors.footnote_popups = {
attach: function attach(context, settings) { attach: function attach(context, settings) {
//js goes here $.each($("li[id^='footnote']"), function(index, value) {
//$('.menu').remove(); var _footnoteText_ = $(value).text();
var footnote_link = $("a[id^='footnote']"); var _id_ = $(this).attr("id");
var footnote_link = $("li[id^='footnote']"); $('a[href$="' + _id_ + '"]').attr('data-toggle', 'tooltip').attr('data-original-title', _footnoteText_).attr('title', '');
});
} }
}; };

18
src/js/js.js

@ -1,14 +1,14 @@
(function ($, Drupal) { (function ($, Drupal) {
Drupal.behaviors.footnote_tooltips = { Drupal.behaviors.footnote_popups = {
attach: function attach(context, settings) { attach: function attach(context, settings) {
//js goes here $.each($("li[id^='footnote']"), function(index, value) {
//$('.menu').remove(); var _footnoteText_ = $(value).text();
var footnote_link = $("a[id^='footnote']"); var _id_ = $(this).attr("id");
var footnote_link = $("li[id^='footnote']"); $('a[href$="' + _id_ + '"]').attr('data-toggle', 'tooltip').attr('data-original-title', _footnoteText_).attr('title', '');
});
} }
}; };

26
src/scss/_tooltips.scss

@ -0,0 +1,26 @@
/* popup container */
.popup {
position: relative;
display: inline-block;
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
}
/* popup text */
.popup .popuptext {
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;
/* Position the popup text - see examples below! */
position: absolute;
z-index: 1;
}
/* Show the popup text when you mouse over the popup container */
.popup:hover .popuptext {
visibility: visible;
}

1
src/scss/style.scss

@ -2,6 +2,7 @@
@import 'lp-preview-grid'; @import 'lp-preview-grid';
@import 'lp-hero'; @import 'lp-hero';
@import 'article-pages'; @import 'article-pages';
@import 'tooltips';
/*on-scroll menu */ /*on-scroll menu */
.fixed-header-enabled.onscroll .header-container ul.menu { .fixed-header-enabled.onscroll .header-container ul.menu {

Loading…
Cancel
Save