Stop javascript from executing -


i know simple cant conditional if below work...

this line below " if ( !$section.id == "no-transition" ) " not correct.

i'm trying stop javascript working on section elements have id of "no-transition".

can point me in right direction?

function initevents() {      $sections.each( function() {              var $section = $( );              if ( !$section.id == "no-transition" ) {              // expand clicked section , scale down others             $section.on( 'click', function() {                      [code taken out shorten post...]                      if( !supporttransitions ) {                             $section.removeclass( 'bl-expand-top' );                     }                      $el.removeclass( 'bl-expand-item' );                      return false;              } );            } } ); 

you should not have multiple elements same id on page.

your if condition should modified to:

... if ( $section.attr('id') != "no-transition" ) {     ... 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -