| 1807 |
rajveer |
1 |
function renderComparision(){
|
|
|
2 |
var SelectID;
|
|
|
3 |
var subtract;
|
|
|
4 |
var check = 0;
|
|
|
5 |
var count = $('.comparision-product-column').length;
|
|
|
6 |
if(count < 4) {
|
|
|
7 |
if(count == 3) {
|
|
|
8 |
subtract = 6;
|
|
|
9 |
} else if(count == 2) {
|
|
|
10 |
subtract = 3;
|
|
|
11 |
} else {
|
|
|
12 |
subtract = 0;
|
|
|
13 |
}
|
|
|
14 |
var parentWidth = $('#comparision-right').width();
|
|
|
15 |
var width = (parentWidth - subtract)/count;
|
|
|
16 |
var newWidth = parseInt(width);
|
|
|
17 |
$('.product-name').width(newWidth);
|
|
|
18 |
$('.comparision-product-column').width(newWidth);
|
|
|
19 |
}
|
|
|
20 |
var styleTrack = $('.jspTrack').attr('style');
|
|
|
21 |
$('.jspTrackbottom').attr('style', styleTrack);
|
|
|
22 |
var styleDrag = $('.jspDrag').attr('style');
|
|
|
23 |
$('.jspDragbottom').attr('style', styleDrag);
|
|
|
24 |
$('.ui-state-default').click(function(){
|
|
|
25 |
var aID = $("li.ui-state-active").children('a:first').attr('href');
|
|
|
26 |
var array = aID.split("#");
|
|
|
27 |
var displayID = array[1];
|
|
|
28 |
var new_aID = $(this).children('a:first').attr('href');
|
|
|
29 |
var new_array = new_aID.split("#");
|
|
|
30 |
var new_displayID = new_array[1];
|
|
|
31 |
$('.'+displayID).each(function(){
|
|
|
32 |
this.style.display = 'none';
|
|
|
33 |
$(this).removeClass("comparision-block").addClass('comparision-hide');
|
|
|
34 |
});
|
|
|
35 |
if(new_displayID == 'vtab-1') {
|
|
|
36 |
// $('#comparision-right').removeClass("product-comparision-internal").addClass('product-comparision-home');
|
|
|
37 |
// $('.scroller-columns').hide();
|
|
|
38 |
// $('#comparision-summary-content').show();
|
|
|
39 |
// $('.comparision-page-title').hide();
|
|
|
40 |
} else {
|
|
|
41 |
// $('#comparision-right').removeClass("product-comparision-home").addClass('product-comparision-internal');
|
|
|
42 |
// $('.scroller-columns').show();
|
|
|
43 |
// $('#comparision-summary-content').hide();
|
|
|
44 |
// $('.comparision-page-title').show();
|
|
|
45 |
}
|
|
|
46 |
$('.comparision-page-title').html(this.title);
|
|
|
47 |
$('.ui-state-active').removeClass("ui-tabs-selected ui-state-active");
|
|
|
48 |
$(this).addClass("ui-tabs-selected ui-state-active");
|
|
|
49 |
$('.'+new_displayID).each(function() {
|
|
|
50 |
var new_count = $('.'+new_displayID).length;
|
|
|
51 |
if(new_count !== count) {
|
|
|
52 |
$('.comparision-product-column').each(function(){
|
|
|
53 |
var check_childern = $(this).find('.'+new_displayID).html();
|
|
|
54 |
if(check_childern == null && check == 0) {
|
| 1818 |
rajveer |
55 |
$(this).append("<div class='"+new_displayID+" comparision-hide comparision-empty-column'><div class='featureslisting'><ul><li class='mainFeature'>No features listed for this category.</li></ul></div></div>");
|
| 1807 |
rajveer |
56 |
check = 1;
|
|
|
57 |
}
|
|
|
58 |
});
|
|
|
59 |
}
|
|
|
60 |
$(this).removeClass("comparision-hide").addClass('comparision-block');
|
| 1818 |
rajveer |
61 |
check = 0;
|
| 1807 |
rajveer |
62 |
this.style.display = 'block';
|
|
|
63 |
});
|
|
|
64 |
return false;
|
|
|
65 |
});
|
|
|
66 |
$('.comparision-hide').each(function(){
|
|
|
67 |
this.style.display = 'none';
|
|
|
68 |
});
|
|
|
69 |
}
|