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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:40:30+00:00 2026-05-22T15:40:30+00:00

Here is my code: (function($){ $.fn.pluginbutton = function (options) { myoptions = $.extend({ left:

  • 0

Here is my code:

(function($){
    $.fn.pluginbutton = function (options) {
        myoptions = $.extend({ left: true });
        return this.each(function () {
            var focus = false;
            if (focus === false) {
                this.hover(function () {
                    this.animate({ backgroundPosition: "0 -30px" }, { duration: 0 });
                    this.removeClass('VBfocus').addClass('VBHover');
                }, function () {
                    this.animate({ backgroundPosition: "0 0" }, { duration: 0 });
                    this.removeClass('VBfocus').removeClass('VBHover');
                });
            }
            this.mousedown(function () {
                focus = true
                this.animate({ backgroundPosition: "0 30px" }, { duration: 0 });
                this.addClass('VBfocus').removeClass('VBHover');
            }, function () {
                focus = false;
                this.animate({ backgroundPosition: "0 0" }, { duration: 0 });
                this.removeClass('VBfocus').addClass('VBHover');
            });
        });
    }
});


$(document).ready(function () {
    $('.smallTabsHeader a').pluginbutton();
});

It gives me an error. What’s wrong?

  • 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-22T15:40:31+00:00Added an answer on May 22, 2026 at 3:40 pm

    This problem is “best” solved by using an anonymous function to pass-in the jQuery object thusly:

    The Anonymous Function Looks Like:

    <script type="text/javascript">
        (function($) {
            // You pass-in jQuery and then alias it with the $-sign
            // So your internal code doesn't change
        })(jQuery);
    </script>
    

    This is JavaScript’s method of implementing (poor man’s) ‘Dependency Injection’ when used alongside things like the ‘Module Pattern’.

    So Your Code Would Look Like:
    Of course, you might want to make some changes to your internal code now, but you get the idea.

    <script type="text/javascript">
        (function($) {
            $.fn.pluginbutton = function(options) {
                myoptions = $.extend({ left: true });
                return this.each(function() {
                    var focus = false;
                    if (focus === false) {
                        this.hover(function() {
                            this.animate({ backgroundPosition: "0 -30px" }, { duration: 0 });
                            this.removeClass('VBfocus').addClass('VBHover');
                        }, function() {
                            this.animate({ backgroundPosition: "0 0" }, { duration: 0 });
                            this.removeClass('VBfocus').removeClass('VBHover');
                        });
                    }
                    this.mousedown(function() {
                        focus = true
                        this.animate({ backgroundPosition: "0 30px" }, { duration: 0 });
                        this.addClass('VBfocus').removeClass('VBHover');
                    }, function() {
                        focus = false;
                        this.animate({ backgroundPosition: "0 0" }, { duration: 0 });
                        this.removeClass('VBfocus').addClass('VBHover');
                    });
                });
            }
        })(jQuery);
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code here: var infiltrationResult; while(thisOption) { var trNode = document.createElement('tr'); var
here my code- create function dbo.emptable() returns Table as return (select id, name, salary
Here is my code: function pauseSound() { var pauseSound = document.getElementById(backgroundMusic); pauseSound.pause(); } I
Here's my code: function mouseOver(variable) { return function() { $(variable).fadeIn(100); }; } function mouseOut(variable)
Can we call this: $('#nomeInput').keypress(function(){ //code here... an event listener? Thanks.
So I know what this does: $(document).ready(function(){ // Your code here... }); Now I
Here is the code: function change_case($str, $type) { return str'.$type.'($str); } change_case('String', 'tolower'); It
Here's my code: function admin_delete($id = null){ $booking = $this->Booking->read(null, $id); if($this->Booking->delete($id)) { $this->Session->setFlash('Booking
Here is my code: function addRcd2(timeOut){ for(var c=0; c less 5; c++){ var rcdi
here is my code: function GetProcedureAddress(var P: FARPROC; const ModuleName, ProcName: AnsiString): Boolean; var

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.