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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:52:49+00:00 2026-05-23T07:52:49+00:00

I have a small plugin for setting the height of an element, based on

  • 0

I have a small plugin for setting the height of an element, based on several variable factors. On the page load, I wanted a delay in order to prevent the height from being set for a number of seconds. I know delay only works on effects, is there a way I can register my plugin as an effect, or do I need to do this another way?

Desire launch code:

$(".app_advert").delay(10000).set_height(2000);

Plugin Code:

       //SetHeight plugin
    (function($){
        $.fn.extend({
            set_height: function(time, callback){
                    scroll = $(window).scrollTop();

                    win_height = $(window).height();
                    document_height = $(document).height();


                    footer_height = $('#footer').height();
                    footer_offset = (document_height-(win_height+scroll));
                    footer_remainder = footer_height-footer_offset;

                return this.each(function(){
                    var x = $(this);

                    if(footer_height-footer_offset<=0){
                        height = 0;
                    } else {
                        height = footer_height-footer_offset;
                    }
                    $(x).stop(true, false).animate({bottom: height}, time, function(){
                        if (callback && typeof callback == 'function') { // make sure the callback is a function
                                callback.call(this); // brings the scope to the callback
                            }

                    });
                });
            }
        });

})(jQuery);
  • 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-23T07:52:50+00:00Added an answer on May 23, 2026 at 7:52 am

    You would need to invoke jQuerys .queue() manually. Could look like;

    $(".app_advert").delay(10000).queue(function() {
        $(this).set_height(2000);
        $(this).dequeue();
    });
    

    You can even chain more queued methods on that construct behind. Beware, all fx methods are queued by default for any other method you want to apply to the current wrapped set, invoke another .queue().

    Have a read: http://api.jquery.com/queue

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

Sidebar

Related Questions

I am setting up a page with jQuery's Cycle plugin and have four divs
I have a small jQuery plugin that I use for form AJAX validation. There
I have a small piece of code that works as a plugin for a
I have small page which has label, DropDownList and a submit button. <div> <asp:label
I am writing a small plugin architecture and I have decided to use MEF
I have a small plugin for Rails where I add permalinks to my model
I've written a small lightbox plugin for jQuery (yes, there are several ready made
I have this small app that loads plugin type components that other users can
I have a small Java/Gradle project. I'm using the Application plugin to create a
I have a small question for you. How can I dinamicaly get a plugin

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.