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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:47:03+00:00 2026-05-28T02:47:03+00:00

How to implement .scrollTo plugin in a dropdown list? When I choose one option

  • 0

How to implement .scrollTo plugin in a dropdown list? When I choose one option from a dropdown list, it gets the value and shows specific div but how to make this div scroll up instantly after the user chooses the option? I used this plugin already with links a href and this is easy but I have no idea how to implement it with dropdowns.
Here is the html:

<select id="miasto">
    <option value="v1">opt1</option>
    <option value="v2">opt1</option>
    <option value="v3">opt1</option>
</select>

Divs to be be displayed after selecting an option:

<div id="v1" class="schowaj" style="display:none">div1 content</div>
<div id="v2" class="schowaj" style="display:none">div2 content</div>
<div id="v3" class="schowaj" style="display:none">div3 content</div>

jQuery:

$(function(){
$('#miasto').change(function(){
    var divToShow = $('#'+$(this).val());
    $('.schowaj').not(divToShow).hide('slow');
    divToShow.show('slow');
}); 
}); 
  • 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-28T02:47:04+00:00Added an answer on May 28, 2026 at 2:47 am

    Wrap your code into select change event listener:

    $('select').change(function() {
        var divToShow = $('#'+$(this).val());
        $('.schowaj').not(divToShow).hide('slow');
        divToShow.show('slow');
    
        var offset = divToShow.offset().top;
        $('body').animate({
            scrollTop: offset
        }, 1500);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this example http://demos.flesler.com/jquery/scrollTo/ . I've managed to implement it but when my
I have successfully implemented the scrollTo jQuery plugin which scrolls to the next div
Implement a link back to a search result page from one of its clicked
I am looking to implement horizontal scrolling using jQuery.SerialScroll (based on jQuery.ScrollTo ). I
I'm a noob with jQuery and I know about scrollTo, but not quite how
I implement this interleave method in java but it doesn't work properly. Where is
Implement an algorithm to merge an arbitrary number of sorted lists into one sorted
I am trying to implement a scroll to DIV (i.e. smooth scrolling with some
I'm trying to implement a tab slider using the .scrollTo plug-in for jQuery. Here's
I am trying to implement some simple tooltip (TipTip) effect, but for some weird

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.