滚动条仅在顶部

时间:2018-08-26 16:27:14

标签: jquery scroll scrollbar

我想只在文本上方设置滚动条,并删除底部的滚动条,类似此处的内容,但是使用没有任何插件的jQuery。有人可以帮忙吗?

function DoubleScroll(element) {
    var scrollbar= document.createElement('div');
    scrollbar.appendChild(document.createElement('div'));
    scrollbar.style.overflow= 'auto';
    scrollbar.style.overflowY= 'hidden';
    scrollbar.style.width= '150px';
    scrollbar.firstChild.style.width= element.scrollWidth+'px';
    scrollbar.firstChild.style.paddingTop= '1px';
    scrollbar.firstChild.appendChild(document.createTextNode('\xA0'));
    scrollbar.onscroll= function() {
        element.scrollLeft= scrollbar.scrollLeft;
    };
    element.onscroll= function() {
        scrollbar.scrollLeft= element.scrollLeft;
    };
    element.parentNode.insertBefore(scrollbar, element);
}

DoubleScroll(document.getElementById('doublescroll'));

链接到jsfiddle http://jsfiddle.net/nsG5w/3/

1 个答案:

答案 0 :(得分:0)

想这样吗?

from django.contrib import admin
from .models import Bug, Project
from django.contrib.admin.models import LogEntry
admin.site.register(LogEntry)


# Register your models here.


class BugDisplay(admin.ModelAdmin):
       list_display = ('Project', 'Status', 'Basic_Description', 'Assigned_to', 'Created', 'Updated')
       list_filter = ('Status', 'Assigned_to', 'Project')
       search_fields = ('Reporters_Mail_ID', 'Reported_by', 'Basic_Description',)



admin.site.register(Bug, BugDisplay)


# Register your models here.

@admin.register(Project)
class ProjectDisplay(admin.ModelAdmin):
       list_display = ('Project_Name','Admin_Name', 'Project_Manager_1', 'Status_of_the_project')
       list_filter = ('Admin_Name', 'Project_Manager_1', 'Status_of_the_project')
       search_fields = ('Project_Name', 'Project_Description', 'Admin_Name', 'Admin_Mail_ID', 'Project_Manager_1 '
                        'Project_Manager_1_Mail_ID', 'Project_Manager_2 ', 'Project_Manager_2_Mail_ID',
                        'Technician_1',
                        'Technician_1_Mail_ID', 'Technician_2', 'Technician_2_Mail_ID', 'Technician_3',
                        'Technician_3_Mail_ID', 'Tester_1', 'Tester_1_Mail_ID', 'Additional_User_1', 'Additional_User_1_Type',
                        'Additional_User_1_Mail_ID', 'Additional_User_2', 'Additional_User_2_Type', 'Additional_User_2_Mail_ID',
                        'Additional_User_3', 'Additional_User_3_Type', 'Additional_User_3_Mail_ID', 'Status_of_the_project', 'Created',
                        'Finish_Date', 'Supporting_Documents'
div p{
  width: 1000px;
  transform:rotateX(180deg);
}
div{
  max-width: 200px;
  overflow-x: scroll;
  transform:rotateX(180deg);
}