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

  • Home
  • SEARCH
  • 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 646625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:37:57+00:00 2026-05-13T21:37:57+00:00

I like to know how works or what means(?) when you define a function

  • 0

I like to know how works or what means(?) when you define a function in the selector in jquery like this.

$(function(){code,code})

because with jquery-ui you can (or must.. I’m really new with this library) set accordion with this code

$(function(){
    // Accordion
    $("#accordion").accordion({ header: "h3" });

    //hover states on the static widgets
    $('#dialog_link, ul#icons li').hover(
        function(){$(this).addClass('ui-state-hover');},
        function(){$(this).removeClass('ui-state-hover');
    });

});

Source: http://jqueryui.com/demos/accordion/

And I have a problem setting accodions inside tabs(also with jquery-ui), but I cann’t find why works buggy, and I think that maybe can I fix the problem understanding this behavior.

And pretty sure that I doesn’t undestood quiet right the selector in jquery, hope you can help me. Thanks in advance, by the way sorry about my poorly english.

  • 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-13T21:37:58+00:00Added an answer on May 13, 2026 at 9:37 pm

    $(somefunction) is a shorthand for $(document).ready(somefunction). So what you’re doing with $(function{}) is defining an anonymous function that will run once the document loads.

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

Sidebar

Related Questions

I like how this works in Zend Framework. I can know which environment I'm
Many times I see statements like following Y.CustomApp.superclass.render.apply(this, arguments); I know how apply works.
I would like to split a line into words. I know this can be
I would like to know how css works under the hood. Whether the html
I would like to know more about how the thread sleep resolution works, and
I would like to know how the recycle image link works, it points to
i'd like to know why this class doesn't work, but if this piece of
I would like to know why the framework might have this strange behavior. If
Im really new to Grails and I try to understand how it works. I
It must be the most common function for what everyone has a code snippet

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.