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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:42:07+00:00 2026-05-26T00:42:07+00:00

I use JQuery : 1.6.4 My target it’s create function who, without giving varabiles

  • 0

I use JQuery : 1.6.4

My target it’s create function who, without giving varabiles in (), can start and stop Script.

When i tried reach.. target.. I was found a few problems…

  1. Specyfic variable\s only for JQuery plugin, with acces from funcions (change variables)

  2. functions move_text

Result for div 190px , and distance 2.5px

190, 187.5, 190… We can.. se fault change of global variable

Should be 190, 187.5, 185…

How resolve this problem (JSON ? Window)?

I tried way with JSON, object… but… i waste a lot of time.. And nothing find…

So.. Way with window[‘distance_iv’] is Good?

Here is my code :

$.fn.emulate_marquee = function( options ) {

    var settings = {
      'ob_name': '', // object who we use...
      'direction': 'left', 
      'scroll_amount': 100, 
      'delay': 25 // Animation speed
    };

    //call in the default otions
            options = $.extend(settings, options);

            return this.each(function(options) {



                var object = $(settings.ob_name);
                window['distance_ob'] = width = object.width(); 

                //object.css(settings.direction , width + 'px'); // Set Width
                //alert(width);

                total_width  = (2 * width) / settings.scroll_amount;
                // total_width

                settings.distance = settings.scroll_amount / (1000/ settings.delay); // Calculate distance for one frame

                width_s = screen.width; // Get screen width




               next_obj = setTimeout (function(){ 
                            move_text()
                          }, 1);

               /*next_res = setTimeout (function(){ 
                            resolution_ch()
                          }, 1);

                */

                var move_text = function()
                {
                    //alert((settings.width - (i * settings.scroll_amount)) + 'px');

                    alert(window['distance_ob'] + 'px');
                    window['distance_ob'] -= settings.distance;
                    object.css(settings.direction , window['distance_ob'] + 'px');
                    alert(window['distance_ob'] + 'px');


                    if (window['distance_ob'] < total_width)
                    {
                        next_obj = setTimeout (function(){ 
                            move_text()
                        }, settings.delay); 
                    }
                    else
                    {
                       next_obj = setTimeout (function(){ 
                            move_text()
                        }, settings.delay);
                        window['distance_ob'] = width;
                    }

                }

                var resolution_ch = function()
                {
                    if (screen.width != width_s)
                    {
                        // change varabiales... for new resolution

                        width_s =  screen.width;
                        distance_ob = width = object.width();
                        alert(width_s + ' ' + object.width());
                        total_width  = (2 * width) / settings.scroll_amoun;


                        alert("Detected Change resolution.... nuke in 5 second... started...");

                    }

                    next_res = setTimeout (function(){ 
                                resolution_ch()
                               }, 1000);



                }


            });
  };
  • 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-26T00:42:08+00:00Added an answer on May 26, 2026 at 12:42 am

    Maybe try saving your global variable to jQuery.data() (ref)

    But since it sounds like you might need to access methods from outside of the plugin, I would suggest checking out some different plugin patterns.

    Check out this awesome “library” of jQuery plugin patterns.

    Especially look at the patterns that save the plugin instance into the jQuery data; which is done by default in all of the widget factory templates. But my personal favorite is the “jquery.namespace.plugin-boilerplate.js”

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

Sidebar

Related Questions

I use jquery post function to go to server and bring the link to
I use jQuery to fade in a caption on a icon mouseover. $(#v1).mouseover(function() {
I'm trying to use this tooltip plugin: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ . I can't seem to get
I use jquery to load and fade in content in a target div. This
for some reason , i can't use jquery . this is my code: <!DOCTYPE
I use jQuery dynamically create tabs, but each time I click one tab, it
Can´t apply an easing method to Jquery ScrollTo: $(#scroller).scrollTo(target,1000,{axis:'x',easing:'linear'}); This doesn´t ease anything... Im
How can I target dynamically loaded content with jQuery? I've read about it a
I use jQuery Validation plugin to ensure what user entered positive cost_of_car in first
I use jQuery to get values of presaved elements from some websites, using paths

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.