I know this is simple but I cant get the conditional if below to work...
This line below " if ( !$section.id == "no-transition" ) " is not correct.
I'm trying to stop javascript from working on section elements that have the id of "no-transition".
Can someone point me in the right direction?
function initEvents() {
$sections.each( function() {
var $section = $( this );
if ( !$section.id == "no-transition" ) {
// expand the clicked section and scale down the others
$section.on( 'click', function() {
[code taken out to shorten post...]
if( !supportTransitions ) {
$section.removeClass( 'bl-expand-top' );
}
$el.removeClass( 'bl-expand-item' );
return false;
} );
}
} );
!=and never!... ==. :)}for the function?idattribute is not built to have the same value assigned to multiple elements. If you attempt to.getElementByIdor use some kind of jQuery event handler like$('#no-transition').click(...it will only return/be applied to the first element. If you want to act on multiple elements, use a sharedclassattribute value.