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 7834335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:07:33+00:00 2026-06-02T13:07:33+00:00

I would like to use the jQuery button elements as standalone – without the

  • 0

I would like to use the jQuery button elements as “standalone” – without the usage of the .button() function (including the rollover effect). Assigning the .button() to each individually would be quite complicated…

What I am looking for is a solution to either use the direct CSS classes of jQuery UI to create some sort of “combined” class, something like: (Notice: “import” used to describe only, I know it’s invalid)

.ui-button-custom {
    "import" ui-state-default;
}
.ui-button-custom:hover {
    "import" ui-state-hover;
}

Other possible way would be to apply .button() dynamically to specific elements, i.e. something like:

// gets all elements with "custom-button" in the class attr
$("a[class*=custom-button").each(function(){
  var t=$(this);
  // apply .button() to all of them
  t.button({
    icons: {
      // get the icon dynamically from the class name:
      // strip off "custom-button-" and the rest is the icon name
      primary: t.attr('class').substring(lastIndexOf('custom-button-'))
    }
  });
});

<a href="#" class="custom-button-ui-icon-refresh">Log In</a>

Notice: This is just an outline of what an solution could look like. I have just a little experience with jQuery UI so maybe someone with more experience could point out problems with this idea…

My questions are:

  1. Is there any other way how to do this?
  2. If not & if pure CSS is not possible – how to complete the JS above (if possible)? I know that the .button() uses .next() which I quite don’t understand…
  • 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-06-02T13:07:34+00:00Added an answer on June 2, 2026 at 1:07 pm

    After some experimenting I finally found the solution:

    <a href="#" id="sss" class="custom-button-ui-icon-refresh">Log In</a>
    <br />
    <a href="#" id="sssaaa" class="custom-button-ui-icon-circle-close">Log In</a>
    <br />
    <br />
    
    <script type="text/javascript">
    $("a[class*='custom-button']").each(function(){
      var t=$(this);
      var icon_class = t.attr('class');
      var icon = icon_class.replace('custom-button-','');
      // alert(icon);
      // apply .button() to all of them
      t.button({
        icons: {
          // get the icon dynamically from the class name:
          // strip off "custom-button-" and the rest is the icon name
          primary: icon
        }
      });
      if ( t.text() == "" ){
         t.css("height", "25px");
         t.css("width", "25px");
      }
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to .get a page and then use jquery to find elements
I would like to know if I can use the following JQuery function on
I would like to know how can I use jQuery to select multiple items
I'm trying to avoid jQuery and would like to use a native solution. How
I would like to use jquery to build a dynamic add/ remove form. IT
I would like use Jquery to submit a form automatically once I select a
I would like to use jQuery to refresh a partial on a page, but
I would like to use widgets from jQuery Mobile - buttons, drop down list,
I would like to use the group_by method, but instead of using a column
I would like to use complex numbers as defined in C99, but I need

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.