sharepoint 2010 - Why does this jQuery not only not work, but break all the other jQuery? -
i doing "fancy" hiding (slideup , slidedown) of elements on sharepoint webpart.
i added handler, though, button:
$(document).on("click", '[id$=btnaddfoapalrow]', function (e) { alert('you mashed foapal button'); if ($('[id$=foapalrow3]').css('display') == 'none') { $('[id$=foapalrow3]').slidedown(); } else if ($(['id$ = foapalrow4]').css('display') == 'none') { $('[id$=foapalrow4]').slidedown(); } });
...but not fails work (the htmltablerows not display when button clicked), other jquery (checkbox change event handlers, etc.) fail work after adding code. commenting out, , old code work still.
why code obliterate whole shebang?
$(['id$ = foapalrow4]')
<- seems there typo here
it should be
$('[id$ = foapalrow4]')
your code after edit:
$(document).on("click", '[id$=btnaddfoapalrow]', function (e) { alert('you mashed foapal button'); if ($('[id$=foapalrow3]').css('display') == 'none') { $('[id$=foapalrow3]').slidedown(); } else if ($('[id$ = foapalrow4]').css('display') == 'none') { $('[id$=foapalrow4]').slidedown(); } });
Comments
Post a Comment