Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing rel external in jquery fitted plugin opens the link 2 times
    primarykey
    data
    text
    <p>Using jquery fitted* plugin, if I put a rel ="external" on the clickable area is successfully opened in new tab, but clicking on the link opens 2 times, how to fix this?</p> <p>for example: i have:</p> <pre><code>&lt;p&gt; text &lt;a rel="external" href="/link"&gt;text2&lt;/a&gt; &lt;/p&gt; </code></pre> <p>text opens perfectly one time, but clicking in text2 the link opens two times</p> <p>the code is:</p> <pre><code>if(typeof jQuery != 'undefined') { jQuery(function($) { $.fn.extend({ fitted: function(options) { var settings = $.extend({}, $.fn.fitted.defaults, options); return this.each( function() { var $t = $(this); var o = $.metadata ? $.extend({}, settings, $t.metadata()) : settings; if($t.find(':has(a)')) { /** * Find the first Anchor * @var object $a */ var $a = $t.find('a:first'); /** * Get the Anchor Attributes */ var href = $a.attr('href'); var title = $a.attr('title'); /** * Setup the Container * Add the 'container' class defined in settings * @event hover * @event click */ $t.addClass(o['class']['container']).hover( function(){ /** * Hovered Element */ $h = $(this); /** * Add the 'hover' class defined in settings */ $h.addClass(o['class']['hover']); /** * Add the Title Attribute if the option is set, and it's not empty */ if(typeof o['title'] != 'undefined' &amp;&amp; o['title']===true &amp;&amp; title != '') { $h.attr('title',title); } /** * Set the Status bar string if the option is set */ if(typeof o['status'] != 'undefined' &amp;&amp; o['status']===true) { if($.browser.safari) { /** * Safari Formatted Status bar string */ window.status = 'Go to "' + href + '"'; } else { /** * Default Formatted Status bar string */ window.status = href; } } }, function(){ /** * "un"-hovered Element */ $h = $(this); /** * Remove the Title Attribute if it was set by the Plugin */ if(typeof o['title'] != 'undefined' &amp;&amp; o['title']===true &amp;&amp; title != '') { $h.removeAttr('title'); } /** * Remove the 'hover' class defined in settings */ $h.removeClass(o['class']['hover']); /** * Remove the Status bar string */ window.status = ''; } ).click( function(){ /** * Clicked! * The Container has been Clicked * Trigger the Anchor / Follow the Link */ if($a.is('[rel*=external]')){ window.open(href); return true; } else { //$a.click(); $a.trigger('click'); window.location = href; } } ); } } ); } }); /** * Plugin Defaults */ $.fn.fitted.defaults = { 'class' : { 'container' : 'fitted', 'hover' : 'hovered' }, 'title' : true, 'status' : true }; }); } </code></pre> <p>*: <a href="http://www.trovster.com/lab/plugins/fitted/" rel="nofollow noreferrer">http://www.trovster.com/lab/plugins/fitted/</a></p> <p>How to solve this? can be fixed?</p> <p>thank you very much</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload