Skip to content

Instantly share code, notes, and snippets.

@gabalis
gabalis / LinkCoveringParentNode.svelte
Last active October 16, 2024 13:45
Svelte component handling click events on its parent element
<script>
export let inputid = '';
export let content = 'Read more…';
export let handleClick = () => {};
</script>
<style>
.coveringparentnode {
position: absolute;
z-index: 0;
Verifying that +matthiou is my blockchain ID. https://onename.com/matthiou
@gabalis
gabalis / tabindex-for-all.js
Created September 29, 2015 10:31
Add tabindex to all elements which do not have one yet
// adding tabindex to all relevant elements which need it
// so we exclude the tabindexed elements
// tabindex = 0 will come after the positively numbered elements
// cf http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex
jQuery(document).ready(function($) {
$('a, input, select, button, textarea').not('[tabindex]').attr('tabindex',0);
});
@gabalis
gabalis / hashgreen
Created October 31, 2011 17:38
A javascript to improve hashbrown — http://daneden.me/hashbrown/
// find all anchors in document
var allAnchors = document.getElementsByTagName('a');
// read them one by one
for (var i = 0, oneAnchor; oneAnchor = allAnchors[i]; i++) {
// is href just a hash ?
if ( oneAnchor.href == '#' )
{
// replace with well behaved