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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -