horizontally scroll sticky navbar

时间:2017-12-18 07:46:03

标签: javascript jquery

I have a list of food in a box and its categories are shown in navigation bar, when user clicks on specific divs, page scrolls down to this box and sticky class is added to navigation bar, as user scrolls down each category gets highlighted (I'm using scrollspy) but it doesn't scroll horizontally so each category is always visible! I'm having this problem on mobile view. I've figured out a solution so I know how many pixels to scroll on each scroll but the problem is that animate is not working with scrollLeft property, I have event tried scrollTo but it only scrolls the window!

import Tkinter as tk

def on_closing():
    pai.cont = False

pai = tk.Tk()
pai.protocol("WM_DELETE_WINDOW", on_closing)
cv = tk.Canvas(pai,width=1100,height=631,bg="white")
cv.pack()
bb = (150,110,550,510)
temp1 = 0
temp2 = 24
t = 0
arc1 = cv.create_arc(bb,start=temp1,extent=temp2,fill="yellow")

pai.cont = True
while pai.cont:
    t=0.51
    temp1+=t
    cv.itemconfig(arc1,start=temp1)
    cv.update()

pai.destroy()

0 个答案:

没有答案