Sha256: bec4750b79e27c11734cfd6da9dba10acc0ae04bf3dcc4c78ca0c5e5a07289da
Contents?: true
Size: 691 Bytes
Versions: 31
Compression:
Stored size: 691 Bytes
Contents
/*! * Highlight areas of text * Copyright 2012, Swirrl IT Limited * All rights reserved */ jQuery.fn.selectText = function(){ var doc = document; var element = this[0]; if (doc.body.createTextRange) { var range = document.body.createTextRange(); range.moveToElementText(element); range.select(); } else if (window.getSelection) { var selection = window.getSelection(); var range = document.createRange(); range.selectNodeContents(element); selection.removeAllRanges(); selection.addRange(range); } }; $(function(){ $('.click_to_select').click(function(){ $(this).selectText(); }); });
Version data entries
31 entries across 31 versions & 1 rubygems