0

I have many divs with the class .contact-box on the page that my Tour is executed on.

I don't want to select all, just the first one.

I tried this:

  {
    element: "#page-wrapper div.contact-box:first-of-type",
    title: "Player Info",
    content: "Here we have a quick snapshot of "
  },

But that didn't work.

How do I what I want to do?

marcamillion
  • 32,933
  • 55
  • 189
  • 380

1 Answers1

0

It turns out that all I had to do was just use my instance variable within my view.

I am implementing this within my profiles#index.html.erb within a <script type=text/javascript> tag, so this is what I did:

  {
    element: '#page-wrapper div.contact-box.profile-<%= @profiles.first.id %>',
    title: "Player Info",
    content: "Blah blah blah"
  },

That simply chose one of those contact-box divs which is what I want.

marcamillion
  • 32,933
  • 55
  • 189
  • 380