In the css files that come with the plugin the pagination has been styled by default. I would like to change the background- and border-color to match every section/page in my project.
Every section has a different background-color and font-color. Im trying to match the pagination to each font color.
This is the code i wrote. It checks if the plugin added the class 'active' to the 'body ul li a' element, wich the plugin adds automaticaly. Then i get the 'href' of this element and use it to store the css 'color' value in a variable. Now i grab the ".onepage-pagination li a:before" elements, wich come out of the onepage css file. And then i add my own css background and color values to all these elements.
The problem seems to be that the plugin crashes when i try to change one of it's defaults.
if ($("body ul li a").hasClass('active')) {
var link_href = $(this).attr('href');
var color = $(link_href).css('color');
$(".onepage-pagination li a:before").css({
"background": color,
"border": '1px solid' + color;
});
};
Where did i go wrong?
$("body ul li a").data() - returns 'object {index: 1}' in console
Would it be possible to use this data attribute in my own css to add style?