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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:53:21+00:00 2026-06-12T08:53:21+00:00

i wrote a jquery function and from there i try to toggle opacity with

  • 0

i wrote a jquery function and from there i try to toggle opacity with animate function but my code is not working. can anyone tell me where is the fault. thanks

            jQuery.fn.blindToggle = function (speed, easing, callback) {
            var _opacity = 0;
            var h = this.height() + parseInt(this.css('paddingTop')) + parseInt(this.css('paddingBottom'));
            $(this).toggle(function () {
                _opacity = 0;
            },
            function () {

                _opacity = 1;
            });
            alert(_opacity);
            return this.animate({ opacity: _opacity,
                marginTop: parseInt(this.css('marginTop')) < 0 ? 0 : -h
            }, speed, easing, callback);
        };
  • 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-12T08:53:22+00:00Added an answer on June 12, 2026 at 8:53 am

    jQuery’s animate has a shortcut for what you’re trying to do:

    $(this).animate({"opacity": "toggle"});
    

    Then you don’t need to implement that logic yourself.

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

Sidebar

Related Questions

i wrote a custom jquery function that accept a callback but not being able
I wrote a PHP code for prepare jQuery function, which can select multipal values
So I wrote the code below: jQuery('#contentWrapper').delegate(.addButton, click, function(){ addRow(jQuery(this)); }); function addRow(thisButton){ var
I wrote a jQuery function that dynamically adds or removes messages boxes from the
$(function(){ $('a').each(function(){ var x=this.href; this.href=www.somesitename.com/filter+this.href; }); }); i wrote the above jQuery script to
My page has jQuery referenced, as other code is already running correctly. But I
I have a listbox that users can add/remove from. To add, there's a text
We allow users to write code which sometimes calls jQuery.ready(function(){..}) multiple times. It seems
So i have this output generated from a jQuery function i built (ajax) which
I wrote the following function as a part of a jQuery plugin I am

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.