开发者

page.VisualEffect in rails 3 with jquery

I am trying to migrate to rails 3 and UJS with jquery

Now my old code is like this:

page['contact_detail_data'].visual_effect :scrollTo,:duration => 0.5,:offset => -30

Now in jquery I think I must use animate

so I thought of :

page['contact_detail_data'].animate :scrollTo,:duration => 0.5,:offset => -30

开发者_如何学PythonBut I am unsure of how to give parameters can someone please guide me ?


you can use something like this :

page.call("anim_up_down","certification_#{params[:index]}",30,500 )

And in javascript

function anim_up_down(ele,extraoffset,duration){

    $('html,body').animate({scrollTop: $('#'+ele).offset().top-extraoffset},duration)

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜