Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

javascript less then function

Hello

Code: Select all

I have the below javascript code in mapping that works if I hard code a VALUE but if I call the value from a localstorage array using mapping the code does not work. 

The value of the database is ('10-15 20-6 5')

The code should display 10-15 20-6 in the grid

and the grid should be grey on top and red on the bottom.

var gridValue = value;

var tour = gridValue.slice(-1);

var tours = gridValue.substring(0, gridValue.length - 1);

if (tour < 1) {
Appery('grid_1').css({'background': 'linear-gradient(red 50%, #b3b3b3 50%)'});
} else if (tour < 6) {
Appery('grid_1').css({'background': 'linear-gradient(#b3b3b3 50%, red 50%)'});
} else {
Appery('grid_1').css({'background': 'linear-gradient(red 50%, red 50%)'});
}

return tours;

Thank you

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

javascript less then function

I found that only the last value from the array is changing the css.

I found out why its not working its becuase each grid is populate from an array and the grid name changes from Grid_1 to Grid_1_1 to Grid_1_2. Anyway around this?

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

javascript less then function

I think I got it thank anyway I used element. Found on this post

https://getsatisfaction.com/apperyio/...

Return to “Issues”