Hi!
I am trying to dynamically add/remove a particular class when the number of cards on the table become larger than 7.
In that case the image must become smaller (resizeItems) and also the placeholder of this image should change size and position.
I thought I could do this by creating two sorts of classes in css. One with the dimensions (and locations) when there are e.g. 6 cards and one when there are e.g. 9 cards. By adding and removing these classes I was hoping the placeholders of these cards would change as well. As the classes already exists there should not be any cache issue.
The image resize works, but the placeholder does not change. All placeholders are equally big and did not change positions either
The css i have:
Anyone knows why this addClass does not have the desired result?
Thanks in advance
I am trying to dynamically add/remove a particular class when the number of cards on the table become larger than 7.
In that case the image must become smaller (resizeItems) and also the placeholder of this image should change size and position.
I thought I could do this by creating two sorts of classes in css. One with the dimensions (and locations) when there are e.g. 6 cards and one when there are e.g. 9 cards. By adding and removing these classes I was hoping the placeholders of these cards would change as well. As the classes already exists there should not be any cache issue.
The image resize works, but the placeholder does not change. All placeholders are equally big and did not change positions either
Code: Select all
if(curSize>6){
this.onTable_1.resizeItems(150, 210, 1650, 630);
if(dojo.hasClass(this.onTable_1, 'table_6_1')){dojo.removeClass( this.onTable_1, 'table_6_1');}
dojo.addClass( this.onTable_1, 'table_9_1');
}
Code: Select all
.table_6_1 {left:10px;top: 5px;width:150px;height:210px;}
.table_9_1 {left:20px;top: 15px;width:105px;height:150px;}
Thanks in advance