-2

I am using a plugin call fullPage.js and I am wondering if I could use jquery to change the bullets of navigation on the right.

So this is the HTML code of the navigation bar

<div id="fp-nav" class="right" style="color: rgb(0, 0, 0); margin-top: -63.5px;">
  <ul>
    <li data-tooltip="">
      <a href="#home" class="">
      <span></span>
      </a>
    </li>
  <ul>
</div>

I am trying out and wondering how do I reach because this is the place to change the bullet to something I want to.

I want to use ionicons.css icons.

So for example, I tried doing this.

$("#fp-nav#home span").addClass("icon ion-home");

This piece of code is not working and I am wondering did I get the path correctly?

Alvaro
  • 37,936
  • 23
  • 138
  • 304
John
  • 167
  • 1
  • 4
  • 18

3 Answers3

1

If you want, you could use pure css like this:

    <html>
    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
    <style type="text/css">
    ul {
      list-style-type: none;
      padding: 0;
    }
    ul li:before{
      font: normal normal normal 14px/1 FontAwesome;
    }
    ul.myList li:before {
    content: "\f015";
    }
    ul.myOtherList li:before {
    content: "\f04e";
    }
    </style>
       <body>
          <ul class="myList">
            <li>foo</li>
            <li>bar</li>
            <li>baz</li>
          </ul>
          <ul class="myOtherList">
            <li>foo</li>
            <li>bar</li>
            <li>baz</li>
          </ul>
        </body>
    </html>

And instead if '>> ' you could use the char and font from your icons.

Andreas Furster
  • 1,338
  • 1
  • 10
  • 26
1

These information can help you:

ul {
 list-style-type: square;
 list-style-position: outside;
 list-style-image: none;
}

and These are the values for "list-style-type" property :

disc
circle
square
decimal
decimal-leading-zero
lower-roman
upper-roman
lower-greek
lower-latin
upper-latin
armenian
georgian
lower-alpha
upper-alpha
none

and if you want your icon , you can use list-style-image property.

IVIajid
  • 190
  • 8
0

I went into jquery.fullPage.js

Somewhere there is this create vertical navigation bar section

All I did was, according to my link anchor names, I create seperate codes to make different icons..

Here it is..

        if(link == 'home') {
        nav.find('ul').append('<li data-tooltip="' + tooltip + '"><a href="#' + link + '"><span class="icon ion-home"></span></a></li>');
        } else if(link == 'about') {
            nav.find('ul').append('<li data-tooltip="' + tooltip + '"><a href="#' + link + '"><span class="icon ion-person"></span></a></li>'); 
        } else if(link == 'serv'){
            nav.find('ul').append('<li data-tooltip="' + tooltip + '"><a href="#' + link + '"><span class="icon ion-gear-b"></span></a></li>');
        } else if(link == 'team'){
            nav.find('ul').append('<li data-tooltip="' + tooltip + '"><a href="#' + link + '"><span class="icon ion-ios7-people"></span></a></li>');
        } else if(link == 'portfolio'){
            nav.find('ul').append('<li data-tooltip="' + tooltip + '"><a href="#' + link + '"><span class="icon ion-images"></span></a></li>');
        } else if(link == 'contact'){
            nav.find('ul').append('<li data-tooltip="' + tooltip + '"><a href="#' + link + '"><span class="icon ion-email"></span></a></li>');
        } else {
            nav.find('ul').append('<li data-tooltip="' + tooltip + '"><a href="#' + link + '"><span></span></a></li>');
        }
John
  • 167
  • 1
  • 4
  • 18