Collapse Container onLoad

hughsweeney
Kilo Expert

On a Catalog Item, I have a script to collapse a container onLoad (see below). There is a UI page within the container. Problem is, the + to expand does not show onLoad but if you click the area where the + should be, does expand. The - and + are then visible.

function onLoad() {

  //Collapses the Related Subcategories container

  jQuery("#img_0fa13b516fbcba80d6c2bc5dbb3ee487").removeClass("container-open");

  jQuery("#0fa13b516fbcba80d6c2bc5dbb3ee487").addClass("container-close");

  document.getElementById('container_row_0fa13b516fbcba80d6c2bc5dbb3ee487').style.display='none';

}

Thoughts on why the + does not show?

1 ACCEPTED SOLUTION

hughsweeney
Kilo Expert

I figured it out shortly after posting...


-------------------------------------------------------------------------------


function onLoad() {


  //Collapses the Related Subcategories container


  toggleVariableContainer('0fa13b516fbcba80d6c2bc5dbb3ee487');


}


-------------------------------------------------------------------------------


That one works


View solution in original post

2 REPLIES 2

hughsweeney
Kilo Expert

I figured it out shortly after posting...


-------------------------------------------------------------------------------


function onLoad() {


  //Collapses the Related Subcategories container


  toggleVariableContainer('0fa13b516fbcba80d6c2bc5dbb3ee487');


}


-------------------------------------------------------------------------------


That one works


Thank you for this. I was able to augment it with an if statement to meet my needs.