/** * Accessible Longdesc - jQuery plugin to make the longdesc attribut accessible to all users, not just those with assistive technology * @requires jQuery - tested with 1.4.2 but might as well work with older versions * * * code: http://github.com/ginader/Accessible-Tabs * please report issues at: http://github.com/ginader/Accessible-Tabs/issues * * Copyright (c) 2010 Dirk Ginader (ginader.com) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Version: 1.0 * * History: * * 1.0 initial release */ (function($) { var debugMode = false; $.fn.extend({ accessibleLongdescShow: function(){ }, accessibleLongdesc: function(config) { debug('init'); var defaults = { infoText: 'pulse aquí para más información acerca de esta imagen', infoIcon: 'ⓘ', wrapperClass: 'accessible-longdesc', iframeWidth: 640, iframeHeight: 480, closeText:'cerrar esta información' }; this.options = $.extend(defaults, config); var o = this; return this.each(function(t) { var el = $(this); debug(el); el .wrap('
') .parent() .append('') .find('button') .bind('mouseenter mouseleave focusin focusout',function(){ $(this).toggleClass('hover'); }) .click(function(){ debug('click open'); var url = el.attr('longdesc'); url = url.replace("#", " #"); el.parent(). append('