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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:16:37+00:00 2026-06-14T02:16:37+00:00

Im using ddSlick plugin for jQuery and the method onSelected should only run when

  • 0

Im using ddSlick plugin for jQuery and the method onSelected should only run when I have chosen an option from the created Dropdown.

Only problem is that the following code I have seems to run the onSelected as soon as the page loads.

Can anyone point me in the right direction?

$('#flag').ddslick({
    imagePosition:"left",
    background:"none",
    width:"66px",
    onSelected: function(data){
        var chosenCountry = data.selectedData.value;
        chosenCountry = chosenCountry.toLowerCase();
        if(data.selectedIndex > 0) {
            if( new_url[1] in oc(['de', 'es','fr','it']) ) {
                console.log("translated pages");
            }
        } else {
            console.log("English site");
        }
    }   
});

jsFiddle

Thanks

  • 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-14T02:16:39+00:00Added an answer on June 14, 2026 at 2:16 am

    I have invented a solution after hours of figuring out whats the problem.

    I directly change something on the code.

    Note: you need to use the unminified version to follow this instructions.


    on line 220

    find:

    function selectIndex(obj, index) {
    

    change it to:

    function selectIndex(obj, index, a) {
    

    Line 270

    find:

    if (typeof settings.onSelected == 'function') {
       settings.onSelected.call(this, pluginData);
    }
    

    change it to:

    if (typeof settings.onSelected == 'function') {
        if (a !== true) settings.onSelected.call(this, pluginData);
    }
    

    And finally on line 146

    find

    selectIndex(obj, index)
    

    then change it to

    selectIndex(obj, index, true)
    

    Hope that helps!

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

Sidebar

Related Questions

I am using an jquery plugin on a dropdown and I am also using
Using mercurial, I've run into an odd problem where a line from one committer
Using jQuery, how do I get the value from a textbox and then load
Using Java,I have to fetch multiple sets of values from an XML file to
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using MVC2 I have an AJAX form which is posting to a bound model.
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using the following as an example (with $db being a previously created database connection
Using SolrNet for querying & faceting. I have a combination of int, tdate and
Using the RichTextArea in GWT, It looks like I can only change the font

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.