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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:54:54+00:00 2026-06-09T14:54:54+00:00

i am trying to apply scroll event to one of element <div style=position: fixed;width:

  • 0

i am trying to apply scroll event to one of element

<div style="position: fixed;width: 30px;height: 300px;overflow: hidden;left: 50%;margin-left: -15px;text-align: center" id="chars_con">
    <?php
    for($i = 97; $i <= 122; $i++){
    ?>
    <div class="chars" ch_to="<?php echo "chars$i"; ?>"><?php echo strtoupper(chr($i));?><div class="chars_a" id="<?php echo "chars$i"; ?>"><?php echo strtoupper(chr($i));?></div></div>
        <?php }
    ?>
</div>

my javascript

window.onload=function(){
        $(".chars").hover(function(){
            $("#"+$(this).attr("ch_to")).show();
        },function(){
            $("#"+$(this).attr("ch_to")).hide();
        });
        $("#chars_con").hover(function(){
            $("#chars_con").css({marginTop:$("#chars_con").scrollTop()});
        },function(){

        });
    }

css

div.chars{background-color: #66ccff;padding: 3px 7px;font-weight: bold;cursor: pointer}
    div.chars:hover{background-color: #990099;color: #ffffff}
    div.chars_a{background-color: #0000ff;color: #ffffff;border: 1px solid #ffff00;font-weight: bold;cursor: pointer;text-align: center;position: absolute;padding: 10px 15px;display: none;margin-left: -13px;margin-top: -25px;overflow: visible}

Overflow issue : i am not able explain this so please remove overflow:hidden form div:#chars_con and see the effect .. i want to do extaly like when we don’t have overflow:hidden. but i want to keep this property because i want to apply scroll effect to this

Scroll issue: i want to scroll this div when i mouse hover it and do scroll

Please ask any question because i am not able to explain but you can get it from the code i mentioned here

  • 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-09T14:54:55+00:00Added an answer on June 9, 2026 at 2:54 pm

    This is a rough example of touchscreen-style scrolling:

    JavaScript/jQuery:

    var last_pos = 0;
    $(document).ready(function() {
        $('#scroll').mousemove(function(e) {
            if(e.clientY > last_pos) {
                $('#scroll').scrollTop($('#scroll').scrollTop() - 5);
            } else {
                $('#scroll').scrollTop($('#scroll').scrollTop() + 5);
            }
            last_pos = e.clientY;
        });
    });
    

    HTML:

    <div id="scroll">
        This text will scroll.<br />
        Line 2<br />
        Line 3<br />
        Blah blah<br />
        This text will scroll.<br />
        This text will scroll.<br />
        This text will scroll.<br />
        Line ?<br />
        Line ?++<br />
        This text will scroll.<br />
        This text will scroll.<br />
    </div>
    

    CSS:

    #scroll {
        width: 200px;
        height: 100px;
        overflow: hidden;
        background: #eee
    }
    

    Example: http://jsfiddle.net/wEKhG/1/

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

Sidebar

Related Questions

I'm trying to apply a style to an adorned element, but I don't know
I am trying to apply a style to the inner div which is contained
I'm trying to apply border-radius effect on a particular div. The code I used
I am trying to apply a custom style to a control whenever it is
I'm trying to apply a CSS mask to an element that also has child
I am trying to apply a box shadow to an img element and I
I am trying apply two background images for an entire table row. One background
I'm trying to recreate the iPhone flick / scroll event in a window using
I am trying to apply the following setting for my .tex files: set scroll=4
im trying to apply text wrap to td (table data) using: .gvUpdatesStyle .updateSummary {width:200px;

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.