Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery actions firing once, but not again
    primarykey
    data
    text
    <p>forgive the code being bulkier than necessary, will tidy it up in due course.</p> <p>everything seems to be working and yet, when you click a link after it's content has already been 'active' nothing happens.</p> <p>i'm sure it's something simple but i can't see it.</p> <p>EDIT: the following code now works in FF and Chrome, but does not work in IE8. Any ideas?</p> <pre><code>$(function(){ //initialize active link to not have a link on ready. var linkId = $('#pricing_body div.active').attr('id'); var activeLink = $('#pricing_nav ul li#'+linkId+' a'); //just the link itself. activeLink.parent().addClass('activeSection'); //var activeLinkContents = activeLink.parent().html(); //the link contained in the the list item and it's contents. //alert(activeLinkContents); var linkContents = activeLink.html(); //text content of the link. activeLink.parent().html(linkContents); //when link is clicked, store it's text for assignment after &lt;a&gt; is stripped out. $('#pricing_nav ul li a').live('click',function(){ var clickedId = $(this).parent().attr('id'); var clickedLinkContents = $(this).html(); $(this).parent().addClass('activeSection'); $(this).parent().html(clickedLinkContents); //replaces &lt;a&gt;&lt;span&gt;name&lt;/span&gt;&lt;/a&gt; with just the span and text. //fadeOut active div and give it inactive class. get list item with same id as div we are fading out. $('#pricing_body div.active').fadeOut('500',function(){ $(this).removeClass('active').addClass('inactive'); var divId = $(this).attr('id'); var sisterLink = $('#pricing_nav ul li#'+divId); sisterLink.removeClass('activeSection'); sisterLink.html('&lt;a href="#"&gt;'+sisterLink.html()+'&lt;/a&gt;'); //put link in between &lt;li&gt;. //fadeIn the div with id of the link that has been clicked. $('#pricing_body div#'+clickedId).fadeIn('500',function(){ $(this).addClass('active').removeClass('inactive'); var newActive = $('#pricing_nav ul li#'+clickedId); }); }); }); }); </code></pre>
    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.
 

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