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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:05:29+00:00 2026-06-15T16:05:29+00:00

I know jquery support delegate function for add and remove a function custom follow

  • 0

I know jquery support delegate function for add and remove a function custom follow event. EX

$("body").delegate("#p", "click", cfunc);

but how to delegate function when page loaded ?

edited——

I show more ex code for more detail in my question: 🙂

i have a function custom name = cfunc()
now i need call it when page load for run many many event inside it.

on the time page loaded, viewer make some event (ex: resize, scroll …) i need undelegate cfunc() and call again with some new var.

— edit 2 —–

sorry everyone, i will write done more code :

this is function i want to delegate

function bbbb_scroll(pos)
    {
        $(document).scroll(function() {
            var _currentpos = $(window).scrollTop();

            if (_currentpos > pos) {
                console.log('match');
            }
        });
    }

now i want add it on to page when stage READY

$(document).ready(function() {
        $(window).delegate("body", "resize", bbbb_scroll);
    });

after all, when user resize the window of browser, i need undelegate bbbb_scroll function and call again with new var ( on pos variable )

  • 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-15T16:05:30+00:00Added an answer on June 15, 2026 at 4:05 pm
    $(document).ready(function(){
    
        var position = 100;
    
        var scrollCallback = function(pos){
    
            var _currentpos = $(window).scrollTop();
    
            if (_currentpos > pos) {
                console.log('match');
            }
        };
    
        var resizeCallback = function(){
    
            $(document).unbind('scroll');
    
            $(document).on('scroll', function(){
    
                scrollCallback(position);
    
            });
        };
    
        $(window).on('resize', resizeCallback);
    
    });
    

    http://api.jquery.com/on/

    http://api.jquery.com/ready/

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

Sidebar

Related Questions

I want to know How JQuery assign function name to $ ?
With jQuery.support and without using jQuery.browser how would I know if the browser would
Does any body know first-child and last-child support old IE like IE6 and IE7.
I know php but my server doesn't support it but support ruby. But unfortunately,
I am trying to make custom autocomplete input (I know about jQuery UI autocomplete,
My question is regarding the jQuery Support system. I'd like to know if it
I don't know how strong the support of RadControls over here is, but it
I don't know jQuery, but it looks to me jQuery has an overwhelming number
does anyone know of a good stable jquery plugin that will support images,swf,flv that
The jquery.hotkeys plugin lets you easily add and remove handlers for keyboard events. However,

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.