-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of class instead of id's for multiple toolbars on same page? #13
Comments
Using data attributes would be far better. |
Ahh, much better! |
Does this mean one can't do this? Not sure why it was closed without at least a comment. |
Hi Sorry I thought this one was solved. If you had HTML like below... <div class="settings-button" data-toolbar="true"><img src="img/icon-cog-small.png" /></div>
<div class="settings-button" data-toolbar="true"><img src="img/icon-cog-small.png" /></div>
<div class="settings-button" data-toolbar="true"><img src="img/icon-cog-small.png" /></div> Then you could load all the toolbars using the Js $('div[data-toolbar]').toolbar({
content: '#user-options',
position: 'top'
}); Is that what you are after? |
Thanks. This works but the toolbar icons do not respond to a click. In this scenario, would I need a click handler for each icon?
Gives me "too much recursion" |
@macsupport |
this on "toolbarItemClick" function do not return the cliked ITEM object but the tool bar trigger itself... |
Hi Paul, $('div[data-toolbar]').toolbar({ above works well but i need the content: part also to be unique? I have a listing page with 10 posts per page i want each post to have a toolbar, currently same content tools for all the post. how do i achieve this. regards, |
I figured it out by writing the init script in the loop, you have to define and different id for each post,
$counter will increase every time loop run and will create different ids |
Is there a method to load the toolbar using classes for both the link and for the content div? I have an image gallery with buttons for each image ( favorite, print, info, etc.) and I want to use a single icon to click to open the toolbar but be able to use classes so I don't have to have an id for each toolbar ( the page has many images on it).
The text was updated successfully, but these errors were encountered: