Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7185295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:23:06+00:00 2026-05-28T18:23:06+00:00

I’m writing a jQuery plugin for a toolbar that has a few buttons in

  • 0

I’m writing a jQuery plugin for a toolbar that has a few buttons in it. I need this toolbar to fadeIn on hover for each element it is called on, e.g. multiple item containers on the page all show the same toolbar when hovered.

This seems easy enough, but I need all the toolbars to be populated with one set of data based on the current user. If I just instantiate the plugin across all item containers, I’ll have to ajax in the data from the user database for each element on the page (could be 100’s).

I don’t want to ajax this data in each time I instantiate the plugin.

My question is where is the best place to store this data to be accessed by all toolbars, or am I thinking of this the wrong way? Should I make one global toolbar with the user data, save it to the DOM and move it to the hovered item? Or just ajax the data in when I need it by attaching it to the toolbar when a button has been clicked?

Edit:
Data I get back from database (bucket id’s to store item information):

{ 'bucket0' : '0', 'bucket1' : '1', 'bucket2' : '2' }

HTML for item page:

<div class="items-container">
    <div class="item" id="item0">
         <div class="item-toolbar" id="item-toolbar-item0">
              <ul class="item-action save">
                  <li id="0">bucket0</li>
                  <li id="1">bucket1></li>
                  <li id="2">bucket2></li>
              </ul>
         </div>
    </div>
    <div class="item" id="item1">
        <div class="item-toolbar" id="item-toolbar-item1">...</div>
    </div>
    <div class="item" id="item2">
        <div class="item-toolbar" id="item-toolbar-item2">...</div>
    </div>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:23:08+00:00Added an answer on May 28, 2026 at 6:23 pm

    If all items have the same parent, then you can just store the data on the parent using jQuery’s .data() like this:

    // in some event handler context
    var self = $(this);
    var parent = self.parent();
    var toolbar = parent.data("toolbar");
    if (!toolbar) {
        // get data via ajax so you can create the toolbar
        // in the success handler, set the data with so other items can find it:
        // parent.data("toolbar", theToolbar);
    }
    

    FYI, I often prefer to use .closest(selector) rather than .parent() because it’s a little less brittle if the div structure gets modified with an extra level for formatting reasons. But, since you haven’t included the relevant HTML, I don’t know what selector would be used with .closest().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT
In my XML file chapters tag has more chapter tag.i need to display chapters
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.