基于数据属性值添加和构建类

时间:2017-01-15 21:55:37

标签: jquery custom-data-attribute

用户将鼠标悬停在定价卡上,按价格从最低到最高排序。当用户将鼠标悬停在价格最低的计划上时,该计划的必备功能卡会突出显示。当用户将鼠标悬停在更昂贵的计划上时,基本功能卡会突出显示以及匹配计划。每个计划和所有较小的计划功能都会得到亮点。

我使用1,2,3的数据属性作为悬停卡和功能div。所以基本计划得到数据层=" 1",标准得到数据层=" 2"等等我可以轻松地定位匹配的数据属性,但我无法计算如何定位匹配和较小的数据属性。

我已尝试将我的功能卡添加到数组中,然后通过这些功能卡添加一个<body> <div id="main"> <div id="content"> <form> <button type="submit" style="display:none"></button> {{> content}} {{> footer}} </form> </div> </div> </body> <template name="content"> <input type="text" id="plate" autocomplete="off"> </template> <template name="footer"> <footer> <button id="clear">CLEAR</button> <button id="info">INFO</button> </footer> </template> 类。这就是我现在所拥有的。

active

1 个答案:

答案 0 :(得分:0)

#include <vector>

//...

int n;
cout << "Enter the number of integers: ";
cin >> n;
int input;

std::vector<int> array( n );

for(int i = 0; i < n; i++){
    cout << "Enter your integer:" << endl;
    cin >> input;
    array[i] = input; 
}

for(int i = 0; i < n; i++){
    cout << array[i] << endl;
}

jQuery selector for attributes with values greater than or less than an amount using > or <