在滚动条中心的缩略图(jQuery的) [英] centre thumbnail in scrollbar (jQuery)

查看:334
本文介绍了在滚动条中心的缩略图(jQuery的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请查看此页面: http://onomadesign.com /字preSS /标识设计/汉斯 - 阿彭策尔/

在右侧的缩略图,链接到不同的投资组合项目(字preSS单一的职位)。我想活动项目的缩略图,当用户进入页面垂直居中的滚动条。现在,它重置滚动条,所以人们忽视的导航。如何使用jQuery做到这一点?

The thumbnails on the right, link to different portfolio items (Wordpress single posts). I want the thumbnail of the active project to be vertically centred in the scrollbar when the user enters the page. Right now, it resets the scrollbar, so people lose sight of navigation. How to accomplish this using jQuery?

感谢。

推荐答案

一类的选择添加到当前连接的Li和使用类添加你的保证金而不是内联CSS

First add the class of "selected" to the li of the current link and use that class to add your margin rather then inline css

看起来你正在使用的 jScrollPlane插件。这将让你做这样的事情与你目前的code。

Looks like you are using the jScrollPlane Plugin. Which will let you do something like this with your current code.

$('。jScrollPaneContainer)scrollTo('currentthumb。');

$('.jScrollPaneContainer').scrollTo('.currentthumb');

对于jScrollPlane scrollTo 功能,请参阅本

See this page for the jScrollPlane scrollTo functionality

这篇关于在滚动条中心的缩略图(jQuery的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆