<?php $modx->regClientStartupScript('/assets/web/system/js/jquery.js'); $modx->regClientStartupScript('/assets/web/system/js/customManager.js'); $modx->regClientCSS('/assets/web/system/css/customManager.css');
if(document.getElementById("modx-window-mi-grid-update-46")){ alert("Element exists"); } else { alert("Element does not exist"); }
if($('#modx-window-mi-grid-update-46').length >0 ){ alert("Element exists"); }
This question has been answered by multiple community members. See the first response.
$(document).ready(function() { /* Your code here */ });
<?php $modx->regClientStartupScript('/assets/web/system/js/jquery.js'); $modx->regClientStartupScript('/assets/web/system/js/customManager.js'); $modx->regClientCSS('/assets/web/system/css/customManager.css');
#modx-window-mi-grid-update-46-tabs .x-tab-panel-header .x-tab-strip li:first-child { display: block; } #modx-window-mi-grid-update-46-tabs .x-tab-panel-header .x-tab-strip li { display: none; }
the solution is simple. Use the multiple-formtabs feature.
Could you post your MIGX - config for that TV, please?
[[getImageList? &tvname=`contentDynamic` &tpl=`contentDynamic.tpl` ]]
[[+content:is=`Main Image`:then=`code here`]] [[+content:is=`Social Share`:then=`<div class="social"></div>`]] [[+content:is=`Main Content`:then=`[[*content]]`]]
[[getImageList? &tpl=`@FIELD:MIGX_formname`&tvname=`MultiColumn`]]
it's not in the DOM until you call it but I tried different ways with not success.That is the problem. You code needs to depend on how you "call" the new element.
it's not in the DOM until you call it but I tried different ways with not success.That is the problem. You code needs to depend on how you "call" the new element.
Mouseenter is a good way to find newly added items to DOM.
Or use the not-so-common mutation observer
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
Or use ExtJS