书签 分享 收藏 举报 版权申诉 / 18

类型今日头条APP案例开发.docx

  • 文档编号:2384609
  • 上传时间:2022-10-29
  • 格式:DOCX
  • 页数:18
  • 大小:21.63KB

#999999;">搜您想搜的

css增加

#topSearch{width:

60%;height:

30px;background:

#F6F5F4;border-radius:

3px;float:

right;margin:

7px8px0px0px;line-height:

30px;color:

#999999;text-align:

left;text-indent:

15px;font-size:

14px;}

制作分类导航

dom及js

changeCate(0);"class="topCateSed">推荐

changeCate

(1);">热点

changeCate

(2);">视频

changeCate(3);">本地

changeCate(4);">社会

changeCate(5);">娱乐

changeCate(6);">问答

changeCate(7);">汽车

changeCate(8);">体育

hui('#topCate').scrollX(8,'a');

//完善点击效果

functionchangeCate(cateId){

hui('#topCate').find('a').removeClass('topCateSed').eq(cateId).addClass('topCateSed');

}

使用了hui的横向滚动、使用hui选择器进行连贯操作完成点击效果、

css部分

#topCate{height:

40px;background:

#F6F5F4;border-bottom:

1pxsolid#E8E8E8;width:

100%;}

#topCatea{display:

block;float:

left;height:

40px;line-height:

40px;width:

15%;text-align:

center;}

.topCateSed{color:

#D43D3D;font-size:

17px!

important;}

制作子窗口、数据加载、下拉刷新

为了实现app的上拉刷新和下拉加载我们需要在入口页面嵌入子窗口。

相关知识:

webview,参考手册:

http:

//www.html5plus.org/doc/zh_cn/webview.html

实现步骤:

1、创建子窗口indexSub.html

2、在入口页嵌入子窗口(会使用plusReady事件)

3、将子页面的返回功能转交给入口页

入口页代码

DOCTYPEhtml>

#999999;">搜您想搜的

changeCate(0);"class="topCateSed">推荐

changeCate

(1);">热点

changeCate

(2);">视频

changeCate(3);">本地

changeCate(4);">社会

changeCate(5);">娱乐

changeCate(6);">问答

changeCate(7);">汽车

changeCate(8);">体育

hui.plusReady(function(){

varsubView=hui.create('indexSub.html',{'top':

'87px',bottom:

'0px'});//此处注意设置bottom

varself=plus.webview.currentWebview();

self.append(subView);

});

hui('#topCate').scrollX(8,'a');

//完善点击效果

functionchangeCate(cateId){

hui('#topCate').find('a').removeClass('topCateSed').eq(cateId).addClass('topCateSed');

}

子窗口代码

DOCTYPEhtml>

举报
举报
版权申诉
版权申诉
word格式文档无特别注明外均可编辑修改;预览文档经过压缩,下载后原文更清晰! 立即下载
配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
今日 APP 案例 开发
提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:今日头条APP案例开发.docx
链接地址:https://www.bdocx.com/doc/2384609.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2022 冰点文档网站版权所有

经营许可证编号:鄂ICP备2022015515号-1

收起
展开