I didn’t explain this all the way through. Unlike classnames, no two things on the page can have the same ID. (Freeway won’t let you, but the spec also says such a page is invalid.) This is helpful if you want to address individual items on the page from JavaScript and need to give each one a different behavior.
When you use jQuery, you use CSS notation to describe what you are trying to change. So this:
$('.foo')
accesses everything on the current page that has the classname ‘foo’ applied to it. A preceding dot in the CSS selector means “class”. Conversely, this:
$('#bar')
accesses the one and only thing on the current page that has the ID ‘bar’ applied to it. As you’ve no doubt guessed, a preceding octothorp means “id”.
If you use Prototype.js, then there are two different accessors to find single (id-based) or multiple (any CSS you can think of) page elements:
$('some_id')
$$('.foo > a[title*="wibble"]')
You can do the latter trick with crazy-deep CSS selectors in jQuery, too; it’s not just for classnames.
Walter
On May 4, 2018, at 11:31 AM, Walter Lee Davis email@hidden wrote:
No, they say quite often in the docs that the owl-carousel class is required. I would not change that. Each one will be self-contained. As a bit of HTML knowledge: classnames can be repeated within a page. You could have one or twenty-one carousels on the page, all with the same classnames, and this would be a valid page. But IDs cannot repeat within a page. If you wanted two different carousels to have two different sets of settings (one auto-move, the other not) then you would use the ID of the element to trigger the owlCarousel() method in JavaScript. (Leave the class="owl-carousel"
part in your page!) But then something like this to initialize them:
$('#owl_one').owlCarousel({ some settings here });
$('#owl_two').owlCarousel({ other settings here });
Walter
On May 4, 2018, at 11:18 AM, billy kimmel email@hidden wrote:
Hey Walter,
The carousel now works!
Interestingly if you look on the Owl Carousel website at the docs, they have stated the brackets incorrectly in the “call to script” Once I change that from your example it all worked.
Now I want to have a video carousel on the same page. Do I need to the give the carousel a unique class different from the other.
For example my first carousel class is owl-carousel"
So the second one… "owl-carousel2 ?
Of course then adding the video option code.
Billy
freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options