I am using fullpageJS https://github.com/alvarotrigo/fullPage.js/ to make my website. However when trying to change the arrow style:
.controlArrow.prev {
left: 50px;
background: url(left.png);
background-repeat: no-repeat;
}
.controlArrow.next {
right: 50px;
}
It doesn't work, can anyone explain why?
First of all, download the lastest version of the plugin (and its CSS file). Fullpage.js no longer uses
controlArrow
butfp-controlArrow
.Make sure you add your own styles after including
jquery.fullpage.css
so you can over write the plugin ones. Also, make sure to over write all the styles applied by default.Take into account that the current arrows are formed by the
border
attribute. not by anybackground
. You need to replace those styles and even change thewidth
andheight
.If you take a look at
jquery.fullpage.css
you will see the styles you need to over write.I wanted to use font-awesome for arrow icons and didn't know what to do at first. But then I looked into the changes that were made in the html-markup after initialization of fuulpage.js:
original html-markup
and using the Raptor's reply to this question about changes in a CSS I've found that it is possible to append a new custom element to an element by default by adding two lines in the script where fullpage() was initialized:
changes in the script
The result is:
final html-markup
Extending @Alvaro's answer, all you need to replace the default border-made arrows by images is as follow: