Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么在js中显示(切换)想要的页面(section)呢? #10

Open
jingxing05 opened this issue May 27, 2014 · 4 comments
Open

怎么在js中显示(切换)想要的页面(section)呢? #10

jingxing05 opened this issue May 27, 2014 · 4 comments

Comments

@jingxing05
Copy link

我想达到这种效果:
页面元素:

<a href='#' target_id='douban_movie_id'>X战警</a> 
<section id="movie_section"></section>
<script id="movie_tpl" type="text/html"></script>

动作--->
点击 这个a链接
1、弹出loading 框
2、调用豆瓣电影的api,zepto的jsonp请求
3、在success中将返回的数据 渲染模板 , $.tmpl
4、关闭loading窗 显示 movie_section

问题是在怎么在js中显示想要的页面呢? 或许这个问题很简单,但确实困扰了我很久了。

1: J.showMask();
2: $.getJSON(douban_api_url + 'subject/' + douban_movie_id + '?apikey=' +                   douban_api_key + '&callback=?', function (remoteData) {
      3: J.tmpl('#movie_section', 'movie_tpl', remoteData); 
      J.Scroll('#moviedetail');//刷新滚动条
      //how to  show movie_section
      //??????
      J.hideMask();
});
@ghost
Copy link

ghost commented May 27, 2014

J.Router.goTo('#movie_section');

@jingxing05
Copy link
Author

刚刚试了,真的可以
之前我也调过这个 方法,因为没加 _section和#,所以一直不成功。
thanks

@jingxing05
Copy link
Author

建议在index.js加上这个演示,像我这种js白痴,就很难知道用法的
然后再 firefox下 welcome页面 不能浏览
谢谢

@shixy
Copy link
Owner

shixy commented May 29, 2014

只支持webkit内核的浏览器

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants