- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Add Custom Float Class?
Hello. I need to add class to my java script where i need to some how add float right if column right shown
//move #column-right to bottom position
$('#column-right').appendTo('.row');
// 3 columns design
if($('#column-left').length > 0 && $('#column-right').length > 0){
$('#column-left').addClass('col-lg-3');
$('#column-right').addClass('col-lg-2');
$('#content').addClass('col-lg-6');
}
// 2 columns design main left
if($('#column-left').length > 0 && $('#column-right').length == 0){
$('#column-left').addClass('col-lg-3');
$('#content').addClass('col-lg-6');
}
// 2 columns design main right
if($('#column-left').length == 0 && $('#column-right').length > 0){
$('#column-right').addClass('col-lg-3');
$('#content').addClass('col-lg-7');
}
Just did this is this correct my first go.
if($('#column-left').length > 0 && $('#column-right').length > 0){
$('#column-left').addClass('col-lg-2');
$('#column-left').addClass('pull-left');
$('#column-right').addClass('col-lg-2');
$('#column-right').addClass('pull-right');
$('#content').addClass('col-lg-6');
}