TP5 display table应用不好用了吗

项目语言:PHP
权限:read-only(如需更高权限请先加入项目)
Index: z.r.js
===================================================================
--- z.r.js (revision 0)
+++ z.r.js (revision 2)
@@ -0,0 +1,33 @@
+function r_mail(x) {//判断邮箱
+ return /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,4}/ig.test(x);
+function r_password(x) {//判断邮箱
+ return /.{6,15}$/ig.test(x);
+function r_weibo(x){//判断分享内容
+ return /^\w{1,140}$/ig.test(x);
+function r_null(x){//判断分享内容
+ // return /[\u4e00-\u9fa5\w]+/ig.test(x);//纯中文
+ return /^[\n\t ]*$/ig.test(x);
+function r_uname(x){
+ var count_zh = x.match(/[\u4e00-\u9fa5]{1}/g);
+ var count_other = x.match(/\w{1}/g);
+ if(count_zh!=null){
count_zh=count_zh.length*2
count_zh=0;
+ if(count_other!=null){
count_other=count_other.length
count_other=0;
+ var count = count_zh+count_
+ if(count &=4 && count&=20){
\ No newline at end of file
Index: z.js
===================================================================
--- z.js (revision 0)
+++ z.js (revision 2)
@@ -0,0 +1,1775 @@
+$(function(){
+ //设置变量
+ post_twitter=$(&#post_twitter&);
+ default_menu_box_option=$(&#default_menu_box_option&);
+ more_menu_box_option=$(&#more_menu_box_option&);
+ back2_default_menu_box_option=$(&#back2_default_menu_box_option&);
+ post_tip=$(&#post_tip&);
+ menu_box=$(&#menu_box&);
+ shadow=$(&#shadow&);
+ sc=$(&.sc&);
+ part_shadow=$(&#part_shadow&);
+ sys_menu=$(&#sys_menu&);
+ menu_button=$(&#menu_button&);
+ window_width=$(window).width();
+ window_height=$(window).height();
+ feed_img_view=$(&#feed_img_view&);
+ feed_img_view_img=$(&#feed_img_view_img&);
+ feed_img_view_img_box=$(&#feed_img_view_img_box&);
+ post_twitter_type=&fb&;
+ msg_tip=$(&#msg_tip&);
+ fi_st=0;//图片预览状态判断
+ feed_id=0;
+ app_id=0;
+ row_id=0;
+ to_uid=0;
+ cc_id=0;
+ cname='';
+ commentid=0;
+ isdel=0;
+ attach_id='';
+ feed_attach_type='';
+ page=$('#content').attr('interface');
+ if(page=='index_list' || page=='square_list'){page_interface=1}else{page_interface=0}
+ // 根据页面判断显示
+ switch(page){
case 'weibo':
$('#open_zz').addClass('hide');
case 'detail':
$('#open_hf_twitter,#open_yw').addClass('hide');
+ //缓存用户ID
+ uid=Number($(&body&).attr(&uid&));
+ //粉丝页面缓存
+ fensi_box=$(&.fensi_box&);
+ fensi_box_guanzhu_button=$(&.fensi_box_guanzhu_button,#i_info_follow&);
+ //设置hash动作缓存
+ back2do=&&;
+ hash_old=&&;
var start_x=0;
var start_y=0;
$(window).resize(function(){
window_width=$(window).width();
window_height=$(window).height();
+//点开选项菜单
+ $(document).on('tap','.c,.c_replyme,.c_atme',function(){
back2do=&shadow.tap&;
feed_id=$(this).attr(&cid&);
row_id=$(this).attr(&rowid&);
app_id=$(this).attr(&appid&);
to_uid=$(this).attr(&touid&);
cc_id=$(this).attr(&ccid&);
// 若原文已被删除,则禁止转发
if($(this).attr('isdel')=='1' || $(this).attr('isdel2')=='1'){
$('#open_zf_twitter').addClass('isdel');
$('#open_zf_twitter').removeClass('isdel');
commentid=$(this).attr(&commentid&);
//若为收到的评论页面,则隐藏转发和赞
if($(this).hasClass(&c_replyme&) || $(this).attr(&type&)==&comment&){
$(&#open_zf_twitter,#digit&).addClass('hide');
$(&#open_zf_twitter,#digit&).removeClass('hide');
if(Number(app_id)==uid){
$(&#digit&).addClass('hide');
}else if($(this).attr(&isdig&)==&0&){
$(&#digit&).text(&赞&).removeClass(&isdig hide&);
//已关注,改变menu_box中的文字
$(&#digit&).text(&已赞&).addClass(&isdig&).removeClass(&hide&);
// 判断下划线显示问题
if(!$(&#digit&).hasClass('hide')){
$('.menu_box_option').removeClass('noborder');
$(&#digit&).addClass('noborder');
}else if(!$('#open_zz').hasClass('hide')){
$('.menu_box_option').removeClass('noborder');
$(&#open_zz&).addClass('noborder');
}else if(!$('#open_yw').hasClass('hide')){
$('.menu_box_option').removeClass('noborder');
$(&#open_yw&).addClass('noborder');
// 计算menu_box高度
var menuBoxHeight=($('#default_menu_box_option&.menu_box_option').length-$('#default_menu_box_option&.hide').length)*45;
menu_box.css({
&margin-top&:&-&+menuBoxHeight/2+&px&,
&margin-left&:&-&+window_width*0.2+&px&,
&top&:$(window).height()/2+&px&,
&left&:$(window).width()/2+&px&
// menu_box.show();
menu_box.show();
$(this).addClass(&c_mousedown&);
shadow.show();
+$(document).on('tap','#digit',function(){
+ var p = {feed_id:feed_id};
+ if(!$(this).hasClass('ismy')){
if($(this).hasClass('isdig')){
var url = U('public/Feed/delDigg');
type:&POST&,
dataType:&json&,
timeout:10000,
success:function(r){
if(r.status==&1&){
$('#digg_'+feed_id).removeClass('digged');
tips('取消赞成功:)',0,1);
$('.c_mousedown').attr(&isdig&,&0&);
more_menu_box_option.hide();
default_menu_box_option.show();
$(&.c,.c_replyme&).removeClass(&c_mousedown&);
menu_box.hide();
shadow.hide();
tips('亲,取消赞失败,可能您已经取消!',1,0);
error:function(xhr,type){
tips('亲,服务器连接出错,求重试!',1,0);
var url = U('public/Feed/addDigg');
type:&POST&,
dataType:&json&,
timeout:10000,
success:function(r){
if(r.status!=&0&){
$('#digg_'+feed_id).addClass('digged');
tips('已赞!',0,1);
$('.c_mousedown').attr(&isdig&,&1&);
menu_box.removeClass(&menu_ani_show&);
menu_box.addClass(&menu_ani_hide&);
more_menu_box_option.hide();
default_menu_box_option.show();
$(&.c,.c_replyme&).removeClass(&c_mousedown&);
menu_box.hide();
shadow.hide();
tips('亲,没有赞成功,求重试!',1,0);
error:function(xhr,type){
tips('亲,服务器连接出错,求重试!',1,0);
+$(document).on('tap','#shadow',function(){
+ back2do=&c.tap&;
+ $(&.c_mousedown&).removeClass(&c_mousedown&);
+ menu_box.hide();
+ shadow.hide();
+ //打开菜单--更多
+ menu_box.on('tap','#open_more',function(){
menu_box_height=menu_box.height();
menu_box.css({
&overflow&:&hidden&
default_menu_box_option.hide();
more_menu_box_option.show();
+ //返回默认菜单
+ $(document).on('tap','#back2_default_menu_box_option',function(){
default_menu_box_option.show();
more_menu_box_option.hide();
+ function digg_tap(){
$('.digg').bind('tap',function(){
feed_id=$(this).data('cid');
var p = {feed_id:feed_id};
if($(this).hasClass('digged')){
$(this).removeClass('digged');
type:&POST&,
url :U('public/Feed/delDigg'),
dataType:&json&,
timeout:10000,
success:function(r){
if(r.status==&0&){
tips('亲,取消赞失败,求重试!',1,0);
$('#c_'+feed_id).attr('isdig','0');
error:function(xhr,type){
tips('亲,服务器连接出错,求重试!',1,0);
$(this).addClass('digged');
type:&POST&,
url :U('public/Feed/addDigg'),
dataType:&json&,
timeout:10000,
success:function(r){
if(r.status==&0&){
tips('亲,没有赞成功,求重试!',1,0);
$('#c_'+feed_id).attr('isdig','1');
error:function(xhr,type){
tips('亲,服务器连接出错,求重试!',1,0);
event.stopPropagation();
+ digg_tap();
+ function sc_tap(){
$(&.sc&).bind(&tap&,function(){
var sc_cid = $(this).attr(&cid&);
var sc_type = $(this).attr(&type&);
if($(this).hasClass(&sc_1&)){
$(&#sc_&+sc_cid).removeClass(&sc_1&);
type:'POST',
url:U('w3g/Index/doUnFavorite'),
dataType:'text',
timeout:10000,
&feed_id&:sc_cid,
&type&:sc_type
success:function(data,status){
if(data==0 || status!='success'){
$(&#sc_&+sc_cid).addClass(&sc_1&);
error:function(data,status){
$(&#sc_&+sc_cid).addClass(&sc_1&);
$(&#sc_&+sc_cid).addClass(&sc_1&);
type:'POST',
url:U('w3g/Index/doFavorite'),
dataType:'text',
timeout:10000,
&feed_id&:sc_cid,
&type&:sc_type
success:function(data,status){
if(data==0 || status!='success'){
$(&#sc_&+sc_cid).addClass(&sc_1&);
error:function(data,status){
$(&#sc_&+sc_cid).removeClass(&sc_1&);
event.stopPropagation();
+ sc_tap();
+ //回复和转发分享
+ menu_box.on('tap','#open_hf_twitter',function(){
location.hash=&hf_twitter&;
+ menu_box.on('tap','#open_zf_twitter',function(){
if(isdel==0){location.hash=&zf_twitter&;}
+ //分享详情页回复
+ $(document).on('tap','#c_comment_post_box',function(){
feed_id=$(this).attr(&weibo_id&);
row_id=feed_
app_id=$(this).attr(&appid&);
location.hash=&hf_twitter_detail&;
+ $(document).on('tap','.c_comments',function(){
cc_id=$(this).attr(&ccid&);
row_id=$(this).attr(&rowid&);
app_id=$(this).attr(&appuid&);
to_uid=$(this).attr(&touid&);
commentid=$(this).attr('ccid');
cname=$('#cc_name_'+cc_id).text();
location.hash=&hf_twitter_c_comments&;
+ $(document).on('tap','#close_post_twitter',function(){
location.hash=&thinksns&;
+ //点击头部输入框
+ $(document).on('tap','#to_post_twitter_input',function(){
location.hash=&post_twitter&;
+ // 右上角按钮点击
+ menu_button_tap=0;
+ if_scroll=0;
+ $(&#menu_button&).addClass(&menu_button_normal&);
+ $(document).on('tap','#menu_button',function(){
if(menu_button_tap==0){
part_shadow.show();
sys_menu.show();
if(if_scroll==1){
$(this).css({
&background-image&: &url(img/menu_button.fw.png)&,
&background-color&:&white&,
&opacity&:1
$(this).css({
&background-image&: &url(img/menu_button.fw.png)&,
&background-color&:&white&,
&opacity&:1
menu_button_tap=1;
if(if_scroll==1){
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&#2980B9&,
&opacity&:0.5
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&&,
&opacity&:1
sys_menu.hide();
part_shadow.hide()
menu_button_tap=0;
+ //用户选择评论+转发//转发+评论
+ $(document).on('tap','.no_check',function(){
$(this).toggleClass('checked');
+ //用户提交回复,ajax
+ $(document).on('tap','#post_twitter_button_submit',function(){
$(this).focus();
content=$(&#post_twitter_input&).val();
var at='';
var content_length_max=Number($('#ptibox').attr(&nums&));
var comment_old='';
if(commentid!=null && commentid&0){
post_feed_id=
post_feed_id=feed_
if($(&#ifShareFeed&).hasClass(&checked&)){
var ifShareFeed = 1;
if(!$('#c_'+feed_id).hasClass('c_replyme')){
var comment_old=$(&#c_content_&+feed_id).html();
var comment_old=$(&#c_content_&+feed_id).html()+'//'+$('#c_content_yw_'+feed_id).html();
if(/^[\t \n]*$/ig.test(comment_old)){
comment_old='';
if($('#c_'+feed_id).has('.c_zf_box').length==0){
comment_old='';
at=$('#c_info_name_'+feed_id).text();
var ifShareFeed = 0;
if($(&#ifAsComment&).hasClass(&checked&)){
var comment=1;
var comment_old=$(&#c_content_&+feed_id).html();
if(/^[\t \n]*$/ig.test(comment_old)){
comment_old='';
if($('#c_'+feed_id).has('.c_zf_box').length==0){
comment_old='';
at=$('#c_info_name_'+feed_id).text();
var comment=0;
if($('#post_twitter_input').data('type')==='image' || $('#post_twitter_input').data('type')==='file'){
feed_attach_type=$('#post_twitter_input').data('type');
attach_id=$('#post_twitter_input').data('attach-id');
if(content.length&content_length_max){
tips(&分享超过&+ content_length_max +&字,请重新编辑后发送&,1,0);
}else if(r_null(content)){
tips(&内容不能为空!&,1,0);
var post_type=$(&#post_form&).attr(&type&);
//处理评论+转发
if(post_type=='hf' && ifShareFeed==1){
post_type='zf';
comment=1;
var comment_old=$(&#c_content_&+feed_id).html();
if(/^[\t \n]*$/ig.test(comment_old)){
comment_old='';
if($('#c_'+feed_id).has('.c_zf_box').length==0){
comment_old='';
at=$('#c_info_name_'+feed_id).text();
ifShareFeed=0;
$(&#c_&+feed_id).attr('feedtype');
$(&#post_form&).attr(&action&,U('w3g/Index/doForward'));
switch(post_type){
case &fb&:
tips(&发表分享中...&,2,0);
case &zf&:
if(ifAsComment==0){
tips(&转发分享中...&,2,0);
tips(&评论转发中...&,2,0);
var comment_old=$(&#c_content_&+feed_id).text();
case &hf&:
tips(&发表评论中...&,2,0);
case &xq_hf&:
tips(&发表评论中...&,2,0);
type:'POST',
url:$(&#post_form&).attr(&action&),
feed_id:post_feed_id,
content:content,
comment_id:commentid,
rowid:row_id,
appid:app_id,
touid:to_uid,
ccid:cc_id,
ifShareFeed:ifShareFeed,
comment:comment,
comment_old:comment_old,
type:$(&#c_&+feed_id).attr('feedtype'),
feed_attach_type:feed_attach_type,
attach_id:attach_id
timeout: 10000,
dataType:'text',
success:function(data){
if(data!=&参数错误& && data!=&内容不能为空& && data!=&0& && data!=&只能上传图片附件& &&data!=&发布失败,字数超过限制&){
$(&.c&).removeClass(&c_mousedown&);
location.hash=&thinksns&;
hash_old=&thinksns&;
switch(post_type){
case &fb&:
tips(&发表成功!&,0,1);
$(&#to_post_twitter&).after(data);
// 阻止事件冒泡
$('.attachs_a').click(function(){event.stopPropagation();});
$('.attachs_a').tap(function(){event.stopPropagation();});
case &zf&:
if(ifAsComment==0){
tips(&转发成功!&,0,1);
tips(&评论并转发成功!&,0,1);
$(&#to_post_twitter&).after(data);
view_pic();
case &hf&:
console.log(ifShareFeed);
tips(&评论成功!&,0,1);
case &xq_hf&:
tips(&评论成功!&,0,1);
$(&#c_comment_box&).html(data);
location.hash=&thinksns&;
view_pic();
viewWeiba();
if(data!=&0&){
tips(data,1,0);
tips(&发表间隔过短,请稍候重试:)&,1,0);
error:function(xhr,type){
tips('服务器反馈错误,请稍候重试:)',1,0);
// tips('error:\mxhr:'+xhr+'\ntype:'+type,1,0);
+ //去除菜单底线
+ $(&.sys_menu_option&).last().css({
&border&:0
+ //点击part_shadow
+ part_shadow.tap(function(){
if(if_scroll==1){
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&#2980B9&,
&opacity&:0.5
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&&,
&opacity&:1
// sys_menu.removeClass(&sys_menu_active&).addClass(&sys_menu_hide&);
sys_menu.hide();
part_shadow.hide();
menu_button_tap=0;
+ //菜单选择写分享
+ $(document).on('tap','#sys_menu_wtire',function(){location.hash=&sys_post_twitter&;});
+ //tap跳转函数
+ function tap2url(x,url){
x.tap(function(){
location.href=
+ //点击进入个人主页
+ $(document).on('tap','#sys_menu_i',function(){
sysmenu2skip(U(&w3g/Index/weibo&),'载入个人主页中');
+ //点击logo进入主页
+ $(document).on('tap','#logo',function(){
location.href=U(&w3g/Index/Index&);
// tips('正在载入主页...',2,0);
+ //点击个人主页中的粉丝,关注按钮
+ $(document).on('tap','#i_info_counts_box_weibo,#i_info_counts_box_fensi,#i_info_counts_box_guanzhu,#i_info_counts_box_shoucang',function(){
location.href=$(this).attr(&linkto&);
// tips('加载'+$(this).children('.i_info_counts_title').text()+'页面中',2,0);
+ //进入个人主页
+ $(document).on('tap','#open_zz',function(){
menubox2skip(U(&w3g/Index/weibo&)+&&uid=&+app_id,'载入作者主页中');
$(&.c_mousedown&).removeClass(&c_mousedown&);
+ //进入分享广场
+ $(document).on('tap','#open_square',function(){
menubox2skip(U('w3g/Index/index'),'载入分享广场中');
$(&.c_mousedown&).removeClass(&c_mousedown&);
+ $(document).on('tap','#sys_menu_square',function(){
sysmenu2skip(U(&w3g/Index/index&),'载入分享广场中');
+ //退出登录
+ $(document).on('tap','#sys_menu_quit',function(){
sysmenu2skip(U(&w3g/Public/log_out&),'正在退出');
+ //查看分享原文
+ $(document).on('tap','#open_yw',function(){
menubox2skip(U(&w3g/Index/detail&)+&&weibo_id=&+feed_id,'载入详情页中');
$(&.c_mousedown&).removeClass(&c_mousedown&);
+ //拖动删除或举报分享(测试功能)
+ c_x=0;//c_position
+ c_y=0;// c_top
+ c_width=0;//初始化点击滑动水平距离
+ c_height=0;//初始化点击滑动垂直距离
+ c_left=0;
+ c_left_0=0;
+ c_top_0=0;//设定垂直滑动距离,防止误操作
+ function zc(x,y){//定义整除
return (x-x%y)/y;
+ $(document).on('touchstart','.c',function(e){
c_x=e.touches[0].pageX;//设置初始点击位置
c_left_0=0;//设置初始状态
var c_d = $(this).siblings(&.c_d&);
if($(this).attr(&appid&)!=uid){
$(this).siblings(&.c_d&).children(&.c_d_yes&).children(&.c_d_text&).text(&举报&);
$(this).siblings(&.c_d&).children(&.c_d_yes&).addClass(&c_d_p&);
+ // 定义下拉变量
+ c_y_length=0;
+ c_scrollDownRefresh=0;
+ if_rlp=0;
+ if_rlp0=0;
+ $(document).on('touchmove','.c',function(e){
c_width=e.touches[0].pageX-c_x;
c_left=c_left_0+c_//实时更新c_left_0
if(Math.abs(c_width)&=150){
$(this).css({
&left&:c_left+&px&
$(this).css({
// 下拉刷新
if($(&body&).scrollTop()==0 && page_interface==1){
if(c_scrollDownRefresh==0){
c_y=e.touches[0].pageY;
console.log('c_y = '+c_y);
c_scrollDownRefresh=1;
c_height=e.touches[0].pageY-c_y;
console.log('e.touches[0].pageY = '+e.touches[0].pageY);
console.log('c_height = '+c_height);
if(c_height&=60 && c_height&=0){
if(c_height-60&=0){
$('#refresh_list').show().css({
'top':c_height-60+'px'
$('#content').css({
'margin-top':c_height+'px'
if(c_height&=40 && if_rlp==0){
$('#refresh_list_p').text('松开可以刷新');
if_rlp0=0;
}else if(c_height&40 && if_rlp0==0){
$('#refresh_list_p').text('下拉可以刷新');
if_rlp0=1;
+ var closeSdRF = function(){
$('#refresh_list').animate({
'top':'-60px'
},300,'linear',function(){
$(this).hide();
$('#refresh_list_p').text('下拉可以刷新');
$('#content').animate({
'margin-top':0
if_rlp0=0;
+ var resetScrollDownRefresh = function(){
if(page_interface==1){
c_scrollDownRefresh=0;
if(c_height&40){
closeSdRF();
$('#refresh_list').animate({
'top':0
},300,'linear');
$('#content').animate({
'margin-top':'60px'
if(page=='index_list'){
url=U('w3g/Index/resetScrollDownRefresh');
}else if(page=='square_list'){
url=U('w3g/Index/resetScrollDownRefreshSquare');
type:'GET',
dataType:'text',
timeout:10000,
since_id:$('.c').first().attr('cid')
beforeSend:function(){
$('#refresh_list_p').text('获取数据中...');
success:function(data){
if(data=='moreThanTen'){
$('#content').load(U('w3g/Index/Index')+' #content');
$('#to_post_twitter').after(data);
closeSdRF();
view_pic();
viewWeiba();
error:function(){
$('#refresh_list_p').text('刷新失败,请稍候重试:)');
setTimeout(closeSdRF,2000);
+ $(document).on('touchend','.c',function(e){
resetScrollDownRefresh();
if(Math.abs(c_width)&=150){
var c_ml = parseInt($(this).css(&left&));
var dw=$(document).width()/2;
console.log(&c_ml=&+c_ml);
console.log(&dw=&+dw);
$(this).parent().siblings().children(&.c_delete&).animate({&left&:0},100).removeClass(&c_delete&);
if(c_ml&-dw){
$(this).animate({&left&:-dw*3+&px&},100).addClass(&c_delete&);
}else if(c_ml&=-dw && c_ml &dw){
$(this).animate({&left&:0},100);
$(this).animate({&left&:dw*2+&px&},100).addClass(&c_delete&);
+ // 取消屏蔽或删除
+ $(document).on('tap','.c_d_no',function(){
$(this).parent().siblings(&.c&).animate({&left&:0},100);
+ //删除/屏蔽分享动作
+ $(document).on('tap','.c_d_yes',function(){
if($(this).hasClass(&c_d_p&)){//举报
var this_c = $(this).parent().siblings(&.c&);
feed_id=this_c.attr('cid');
var content = this_c.children(&.c_content&).html();
var url = U('widget/Denouce/post');
var source_url = U(&w3g/Index/detail&)+&&weibo_id=&+feed_
var app_id = this_c.attr(&appid&);
var p = {uid:$(&body&).attr(&uid&), aid:feed_id, content:content, from:&feed&, fuid:app_id, reason:'', source_url:source_url};
tips('已提交你的举报:)',1,0);
this_c.animate({&left&:0},100);
// 隐藏该条分享
// var this_parent=this_c.parent();
// this_parent.hide();
type:&POST&,
dataType:&json&,
timeout:10000,
success:function(r){
if(r.status != '0'){
tips('举报失败,请重试:)',1,0);
// this_parent.show();
}else{//删除
var this_c = $(this).parent().siblings(&.c&);
var weibo_id = this_c.attr(&cid&);
var from = this_c.attr(&index&);
var this_parent=this_c.parent();
this_parent.hide();
type:&POST&,
url:U('w3g/Index/doDelete'),
&weibo_id&:weibo_id,
&from&:from,
&type&:this_c.attr('feedtype')
timeout:10000,
dataType:&json&,
success:function(r){
if(r.status == '0'){
tips('删除失败,请重试:)',1,0);
this_parent.show();
if($('body').has('#c_comment_post_box').length&0){
location.href=U(&w3g/Index/Index&);
+ //检测页面滚动,浮动右上角按钮
+ $(window).scroll(function(){
s_t=$(&body&).scrollTop();
if(s_t&=46){
menu_button.addClass(&menu_button_show&);
if_scroll=1;
if(menu_button_tap==0 && (menu_button.css('background-color')!=&#2980B9&||menu_button.css('background-color')!=0.5)){
menu_button.css({
&background-color&:&#2980B9&,
&opacity&:0.5
}else if(menu_button.css('background-color')!=&#FFFFFF&||menu_button.css('background-color')!=1){
menu_button.css({
&background-color&:&#FFFFFF&,
&opacity&:1
menu_button.removeClass(&menu_button_show&);
if(menu_button_tap==0 && (menu_button.css('background-color')!=&&||menu_button.css('background-color')!=1)){
menu_button.css({
&background-color&:&&,
&opacity&:1
}else if(menu_button.css('background-color')!=&#ffffff&||menu_button.css('background-color')!=1){
menu_button.css({
&background-color&:&#FFFFFF&,
&opacity&:1
if_scroll=0;
//判断图片
if(fi_st==-1){
if(feed_img_view_img_box.height()&$(window).height()){
if(s_t&parseInt(feed_img_view.css(&top&))+feed_img_view_img_box.height()-$(window).height()){
window.scrollTo(0,parseInt(feed_img_view.css(&top&))+feed_img_view_img_box.height()-$(window).height());
}else if(s_t&st){
window.scrollTo(0,st);
//判断微吧帖子
if($(&#weiba_box&).length==1){
var wbbox=$(&#weiba_box&).height();
if(st+wbbox-$(window).height()&s_t){
window.scrollTo(0,st+wbbox-$(window).height());
}else if(s_t&st){
window.scrollTo(0,st);
+ //分享列表点击图片
+ function view_pic(){
$(&.feed_img_box&.feed_img&).tap(function(){
feed_img_view_img_box.html(&&);
feed_img_view.css({
feed_img_view.show();
if($(this).siblings().length==0){
$('&div class=&fivfb&&&img class=&feed_img_view_full& src=&'+$(this).attr(&bm&)+'&&&/div&').appendTo(feed_img_view_img_box);
index=$(this).index();
scroll_px=0;
$(this).parent().children().each(function(){
this_index=$(this).index();
$('&div id=&fivfb_'+this_index+'& class=&fivfb&&&img class=&feed_img_view_full& src=&'+$(this).attr(&bm&)+'&&&/div&').appendTo(feed_img_view_img_box);
if(this_index&index){
scroll_px=scroll_px+$(&#fivfb_&+this_index).height();
window.scrollTo(0,st+scroll_px);
event.stopPropagation();
+ view_pic();
+ //关闭图片查看层
+ $(document).on('tap','#feed_img_view_close,#feed_img_view_bg',function(){
feed_img_view.hide();
feed_img_view_img_box.html(&&);
+ // 初始化hash界面
+ function restHashDisplay(){
$(&.no_check&).hide().removeClass(&checked&);
post_twitter.hide();
$(&#post_twitter_input&).val(&&);
$(&#search_box&).hide();
$(&#sibi&).val(&&);
// tiph();
// sendmsg
$(&#post_message&).hide();
$(&#post_message_input&).val(&&);
$(&#post_message_input&).text(&&);
$(&#post_msg_to&).val(&&);
+ //hash动作判断
+ function hash2do(){
hash=location.
switch(hash)
case &#hf_twitter&:
$('#file_list').html('');
$('#ajax_iframe').remove();
$('#post_twitter_button_file').hide();
if(isdel==0){
$(&#ifShareFeed&).show();
}else if(isdel==1){
$(&#ifShareFeed&).hide();
post_twitter_type=&hf&;
post_twitter.show().show();
more_menu_box_option.hide();
default_menu_box_option.show();
menu_box.hide();
shadow.hide();
var c=$(&.c&);
post_tip.text(&回复分享&);
var c_page ='';
if(c.first().attr(&page&)!=null){
c_page=c.first().attr(&page&);
if($('.c_replyme').length&0 || $('.c_mousedown').attr(&type&)==&comment&){
var pf_action=U('w3g/Index/doCommentD');
var pf_action=U('w3g/Index/doComment');
$(&#post_form&).attr({
&action&:pf_action,
&type&:c_page+&hf&
$(&#post_twitter_input&).focus();
$(&.c_mousedown&).removeClass(&c_mousedown&);
case &#zf_twitter&:
$('#file_list').html('');
$('#ajax_iframe').remove();
$('#post_twitter_button_file').hide();
$(&#ifAsComment&).show();
hash_old=location.
post_twitter_type=&zf&;
post_twitter.show();
more_menu_box_option.hide();
default_menu_box_option.show();
menu_box.hide();
shadow.hide();
var c=$(&.c&);
$(&.c_mousedown&).removeClass(&c_mousedown&);
post_tip.text(&转发分享&);
$(&#post_form&).attr({
&action&:U('w3g/Index/doForward'),
&type&:&zf&
$(&#post_twitter_input&).focus();
case &#hf_twitter_detail&:
$('#file_list').html('');
$('#ajax_iframe').remove();
$('#post_twitter_button_file').hide();
$(&#ifShareFeed&).show();
if(isdel==0){
$(&#ifShareFeed&).show();
}else if(isdel==1){
$(&#ifShareFeed&).hide();
post_twitter_type=&hf&;
post_twitter.show();
post_tip.text(&回复分享&);
$(&#post_form&).attr({
&action&:U('w3g/Index/doComment'),
&type&:&xq_hf&
$(&#post_twitter_input&).focus();
case &#hf_twitter_c_comments&:
$('#file_list').html('');
$('#ajax_iframe').remove();
$('#post_twitter_button_file').hide();
$(&#ifShareFeed&).show();
if(isdel==0){
$(&#ifShareFeed&).show();
}else if(isdel==1){
$(&#ifShareFeed&).hide();
post_twitter_type=&xq_hf&;
post_twitter.show();
post_tip.text(&回复@&+cname);
$(&#post_form&).attr({
&action&:U('w3g/Index/doCommentD'),
&type&:&xq_hf&
$(&#post_twitter_input&).focus();
case &#thinksns&:
restHashDisplay();
restHashDisplay();
restHashDisplay();
case &#post_twitter&:
$('#post_twitter_input').data('attach-id','');
$('#file_list').html('');
if($('#ptibox').has('#ajax_iframe').length===0){
$('#ptibox').prepend('&iframe src=&'+U('w3g/Index/ajax_iframe')+'& id=&ajax_iframe&&&/iframe&');
$('#post_twitter_button_file').show();
post_twitter_type=&fb&;
post_twitter.show();
post_tip.text(&发表分享&);
$(&#post_form&).attr({
&action&:U('w3g/Index/doPost'),
&type&:&fb&
$(&#post_twitter_input&).focus();
case &#sys_post_twitter&:
$('#post_twitter_input').data('attach-id','');
$('#file_list').html('');
if($('#ptibox').has('#ajax_iframe').length===0){
$('#ptibox').prepend('&iframe src=&'+U('w3g/Index/ajax_iframe')+'& id=&ajax_iframe&&&/iframe&');
$('#post_twitter_button_file').show();
post_twitter_type=&fb&;
post_twitter.show();
var c=$(&.c&);
c.removeClass(&c_mousedown&);
if(if_scroll==1){
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&#2980B9&
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&&
// sys_menu.removeClass(&sys_menu_active&).addClass(&sys_menu_hide&);
sys_menu.hide();
part_shadow.hide();
menu_button_tap=0;
post_tip.text(&发表分享&);
$(&#post_form&).attr({
&action&:U('w3g/Index/doPost'),
&type&:&fb&
$(&#post_twitter_input&).focus();
event.stopPropagation();
case &#search&:
if(if_scroll==1){
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&#2980B9&
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&&
// sys_menu.removeClass(&sys_menu_active&).addClass(&sys_menu_hide&);
sys_menu.hide();
part_shadow.hide();
menu_button_tap=0;
$(&#search_box&).show();
$(&#sibi&).focus();
case &#sys_menu_sendmsg&:
$(&#post_message&).show();
$(&#post_msg_to&).focus();
if(if_scroll==1){
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&#2980B9&
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&&
// sys_menu.removeClass(&sys_menu_active&).addClass(&sys_menu_hide&);
sys_menu.hide();
part_shadow.hide();
menu_button_tap=0;
case &#post-msg-to-uid&:
$(&#post_message&).show();
$(&#post_message_input&).focus();
+ location.hash='';
+ //监听hashchange
+ window.addEventListener(&hashchange&, hash2do, false);
+ $(&#page_sel&).change(function(){
link=$(this).val();
location.href=
+ //记录滚动值
+ st=$(&body&).scrollTop();
+ function rst(){
st=$(&body&).scrollTop();
+ //回滚保持滚动值
+ function s2(){
window.scrollTo(0,st);//未计算ajax添加的dom高度,应+之
+ //修正略所图尺寸问题
+ function feed_img_size(){
$(&.feed_img_box&.feed_img&).each(function(){
width=$(this).width();
$(this).css({
&height&:width+&px&
+ feed_img_size();
+ //粉丝页面动作
+ fensi_box_guanzhu_button.tap(function(){//涉及事件冒泡,推至第二轮优化
if($(this).attr(&sort&)==&fs_list&){
type=$(this).attr(&type&);
if($(this).attr(&type&)==&follow&){
$(this).attr(&type&,&unfollow&);
if($(this).attr(&isfollower&)==1){
$(this).text(&已互粉&);
$(this).text(&已关注&);
$(this).removeClass(&fensi_box_guanzhu_button_1&);
$(this).attr(&type&,&follow&);
$(this).text(&加关注&);
$(this).addClass(&fensi_box_guanzhu_button_1&);
if($(this).hasClass(&i_info_followed&)){
$(this).removeClass(&i_info_followed&);
$(this).text(&关注&);
$(this).addClass(&i_info_followed&);
$(this).text(&取消关注&);
$(this).attr(&linkto&),
function(data){
if(data!=1){
if($(this).attr(&sort&)==&fs_list&){
if($(this).attr(&type&)==&follow&){
$(this).attr(&type&,&unfollow&);
$(this).text(&已互粉&);
$(this).removeClass(&fensi_box_guanzhu_button_1&);
$(this).attr(&type&,&follow&);
$(this).text(&加关注&);
$(this).addClass(&fensi_box_guanzhu_button_1&);
if($(this).hasClass(&i_info_followed&)){
$(this).removeClass(&i_info_followed&);
$(this).text(&关注&);
$(this).addClass(&i_info_followed&);
$(this).text(&取消关注&);
+ //粉丝列表点击跳转个人主页
+ $(document).on('tap','.fensi_box',function(){
location.href=U(&w3g/Index/weibo&)+&&uid=&+$(this).attr(&uid&);
+ //粉丝页面动作结束
+ // 监听消息
+ readMsgCount=0;
+ function readNewMsg()
type:'GET',
url: U('w3g/Index/mcount'),
dataType:'json',
success:function(data,status){
var msgcount=parseInt(data.at)+parseInt(data.cm)+parseInt(data.notify)+parseInt(data.msg);
if(msgcount==0){
$(&#msg_tip_box&).css({
&left&:&-114px&
}else if(msgcount&0){
msg_tip.children(&#msg_tip_p&).text(msgcount);
$(&#msg_tip_box&).css({
if(data.msg&0){
$(&#msg_tip,#sys_menu_msg&).attr('linkto','msg');
}else if(data.at&0){
$(&#msg_tip,#sys_menu_msg&).attr('linkto','at');
}else if(data.cm&0){
$(&#msg_tip,#sys_menu_msg&).attr('linkto','cm');
$(&#msg_tip,#sys_menu_msg&).attr('linkto','notify');
readMsgCount=0;
error:function(){
console.log(status);
readMsgCount+=1;
if(readMsgCount&=10){
tips(&服务器链接超时,请检查您的网络连接:)&,1,0);
readMsgCount=0;
+ readNewMsg();
+ setInterval(readNewMsg,30000);
+ //个人消息提示Tap
+ $(document).on('tap','#msg_tip,#sys_menu_msg',function(){
var linkto=$(this).attr(&linkto&);
if($(this).attr('id')=='msg_tip'){
switch(linkto){
case &at&:
// tips('加载@我页面',2,0);
location.href=U('w3g/Index/atme');
case &cm&:
// tips('加载评论消息',2,0);
location.href=U('w3g/Index/replyMe');
case &msg&:
// tips('加载私信页面',2,0);
location.href=U('w3g/Message/index');
case &notify&:
// tips('加载系统通知',2,0);
location.href=U('w3g/Message/notify');
switch(linkto){
case &at&:
sysmenu2skip(U(&w3g/Index/atme&),'加载@我页面');
case &cm&:
sysmenu2skip(U(&w3g/Index/replyMe&),'加载评论消息');
case &msg&:
sysmenu2skip(U('w3g/Message/index'),'加载私信页面');
case &notify&:
sysmenu2skip(U('w3g/Message/notify'),'加载系统通知');
+ $(document).on('tap','#tip_ik',function(){
+ //个人页面判断导航
+ function iin(){
var act = $(&#i_info_counts&).attr(&act&);
switch(act){
case &weibo&:
$(&#i_info_counts_box_weibo&).addClass(&iin&);
case &following&:
$(&#i_info_counts_box_guanzhu&).addClass(&iin&);
case &followers&:
$(&#i_info_counts_box_fensi&).addClass(&iin&);
case &favorite&:
$(&#i_info_counts_box_shoucang&).addClass(&iin&);
+ //消息页面导航判断+链接
+ $(document).on('tap','.msg_navs',function(){
var act=$(this).attr(&linkto&);
switch(act){
case &msg&:
location.href=U('w3g/Message/index');
case &at&:
location.href=U('w3g/Index/atme');
case &cm&:
location.href=U('w3g/Index/replyMe');
case &notify&:
location.href=U('w3g/Message/notify');
+ function mni(){
var act=$(&#msg_nav&).attr(&act&);
switch(act){
case &at&:
$(&#mag_nav_at&).addClass(&mni&);
case &cm&:
$(&#mag_nav_cm&).addClass(&mni&);
+ //搜索页面动作
+ $(document).on('tap','#search_top_box',function(){var key=$('#search_top_input').text(); $(&#sibi&).val(key);location.hash='search';});
+ $(document).on('tap','#close_search_box',function(){location.hash=&thinksns&;});
+ $(document).on('tap','.ssc',function(){
$(&.ssc&).removeClass(&ssc_check&);
$(this).addClass(&ssc_check&);
+ $(document).on('tap','#sys_menu_search',function(){location.hash='search';});
+ $(document).on('tap','#post_search_submit',function(){
$(this).focus();
var s_key = $(&#sibi&).val();
var s_type = $(&.ssc_check&).attr(&stype&);
if(s_key==''){
tips('请输入搜索内容',1,0);
if($(&#search_top_box&).length&0){
tips('搜索数据中',2,0);
type:'POST',
url:U('w3g/Index/doSearch')+&&&+s_type,
timeout:10000,
success:function(data){
$(&#serach_result&).html(data);
$(&#search_top_input&).text(s_key);
location.hash=&thinksns&;
switch(s_type){
case &weibo&:
view_pic();
viewWeiba();
digg_tap();
case &user&:
$('.fensi_box_guanzhu_button').tap(function(){//涉及事件冒泡,推至第二轮优化
if($(this).attr(&sort&)==&fs_list&){
type=$(this).attr(&type&);
if($(this).attr(&type&)==&follow&){
$(this).attr(&type&,&unfollow&);
if($(this).attr(&isfollower&)==1){
$(this).text(&已互粉&);
$(this).text(&已关注&);
$(this).removeClass(&fensi_box_guanzhu_button_1&);
$(this).attr(&type&,&follow&);
$(this).text(&加关注&);
$(this).addClass(&fensi_box_guanzhu_button_1&);
if($(this).hasClass(&i_info_followed&)){
$(this).removeClass(&i_info_followed&);
$(this).text(&关注&);
$(this).addClass(&i_info_followed&);
$(this).text(&取消关注&);
$(this).attr(&linkto&),
function(data){
console.log(data);
if(data!=1){
if($(this).attr(&sort&)==&fs_list&){
if($(this).attr(&type&)==&follow&){
$(this).attr(&type&,&unfollow&);
$(this).text(&已互粉&);
$(this).removeClass(&fensi_box_guanzhu_button_1&);
$(this).attr(&type&,&follow&);
$(this).text(&加关注&);
$(this).addClass(&fensi_box_guanzhu_button_1&);
if($(this).hasClass(&i_info_followed&)){
$(this).removeClass(&i_info_followed&);
$(this).text(&关注&);
$(this).addClass(&i_info_followed&);
$(this).text(&取消关注&);
view_pic();
viewWeiba();
digg_tap();
switch(s_type){
case &weibo&:
location.href=U('w3g/Index/doSearch')+&&key=&+s_key+&&weibo&;
case &user&:
location.href=U('w3g/Index/doSearch')+&&key=&+s_key+&&user&;
location.href=U('w3g/Index/doSearch')+&&key=&+s_
+ //全局发送私信动作
+ $(document).on('tap','#sys_menu_sendmsg',function(){
location.hash=&sys_menu_sendmsg&;
+ $(document).on('tap','#close_post_message',function(){
location.hash=&thinksns&;
+ $(&#post_msg_to&).on('keydown',function(){//查询用户
$(&#pm2l&).width($('#post_msg_to').width()-2);
var url = U('widget/SearchUser/search');
var username = $(this).val();
var p = {key:username, follow:0, noself:1};
var message_to = 0;
type:&POST&,
dataType:&json&,
timeout:10000,
success:function(r){
if(r.data != null){
var data = r.
var pm2l_html='';
$.each(data,function(index,item){
pm2l_html += '&div class=&pm2lc& uid=&'+ item.uid +'&&&img class=&pm2lci& src=&'+ item.avatar_small +'& width=30 height=30&&div class=&pm2lcn&&'+ item.uname +'&/div&&/div&';
$(&#pm2l&).html(pm2l_html).removeAttr(&isnull&).show();
var pm2l_html = '&div class=&pm2lc& uid=&0&&&div class=&pm2lcn&&没有该用户&/div&&/div&';
$(&#pm2l&).html(pm2l_html).attr(&isnull&,&yes&).show();
error:function(xhr,type){
+ $(&#post_msg_to&).on('focus',function(){
setTimeout(s2(),1000);
+ $(document).on('tap','.pm2lc',function(){//选择用户
if($(this).attr(&isnull&)!=&yes&){
$(&#post_msg_to&).val($(this).children('.pm2lcn').text());
$(&#pm2l&).hide();
+ $(document).on('tap','#post_message_button_submit',function(){//发送私信
$(this).focus();
var url = U('widget/SearchUser/search');
var username = $(&#post_msg_to&).val();
var p = {key:username, follow:0, noself:1};
var message_content = $(&#post_message_input&).val();
var message_to = 0;
//首先检查用户名是否存在,若存在,则发送私信
if(username==''){
tips(&用户名不能为空,请填写&,1,0);
}else if(message_content==''){
tips(&私信内容不能为空,请填写:)&,1,0);
type:&POST&,
dataType:&json&,
timeout:10000,
beforeSend:function(){
tips(&验证用户信息&,2,0);
success:function(r){
if(r.data != null && r.data[0].uname == username){
message_to = Number(r.data[0].uid);
url = U('public/Message/doPost');//若用户存在,重定义post地址
var p = {to:message_to, content:message_content, attach_ids:''};
type:&POST&,
dataType:&json&,
timeout:10000,
// context:x,
beforeSend:function(){
tips(&发送中&,2,0);
success:function(r){
if(r.status == 1 && r.data == &发送成功&){
tips(&发送成功!&,0,1);
location.hash=&thinksns&;
tips(&发送失败,请重试:(&,1,0);
error:function(xhr,type){
tips(&连接服务器出错,请重试:(&,1,0);
tips(&没有该用户,检查一下是不是输入错了?&,1,0);
error:function(xhr,type){
tips(&连接服务器出错,请重试:(&,1,0);
+ //消息盒子-&私信列表
+ $(document).on('tap','.c_msg',function(){
location.href=U('w3g/Message/detail')+'&id='+$(this).attr(&msid&);
+ //点击分享列表中的话题和@XXX的连接
+ c_a = $(&.c_a&);
+ c_a.tap(function(){
location.href=$(this).attr('href');
event.stopPropagation();
+ //消息盒子-&收到的评论页面
+ //设置message_header
+ if($('#content').attr(&msgpage&)!=null){
$(&.msg_navs&).removeClass(&mni&);
switch($('#content').attr(&msgpage&)){
case &replyMe&:
$(&#mag_nav_cm&).addClass(&mni&);
case &atme&:
$(&#mag_nav_at&).addClass(&mni&);
case &msg_list&:
$(&#mag_nav_msg&).addClass(&mni&);
$(&#mag_nav_notify&).addClass(&mni&);
+ // 显示微吧内容
+ function viewWeiba(){
$(&.loadweiba&).tap(function(){
event.stopPropagation();
url = U('widget/FeedList/getPostDetail');
var post_id = $(this).attr(&weibaid&);
var p = {post_id:post_id};
type:&POST&,
dataType:&json&,
timeout:10000,
// context:x,
beforeSend:function(){
tips(&获取内容中...&,2,0);
success:function(r){
if(Number(r.feed_id)&0){
var html = '&div id=&weiba_box& style=&top:'+st+'px&&&div id=&weiba_close&&&/div&&div id=&weiba_title&&'+r.title+'&/div&&div id=&weiba_content&&'+r.content+'&/div&&/div&';
$(&body&).append(html);
$(&#weiba_content table&).removeAttr(&width&);
tips(&内容获取出错,请重试:(&,1,0);
error:function(xhr,type){
tips(&连接服务器出错,请重试:(&,1,0);
+ viewWeiba();
+ $(document).on(&tap&,&#weiba_close&,function(){
$(&#weiba_box&).remove();
+ // 弹出菜单跳转函数,优化体验
+ function menubox2skip(skip2url,tiptext){
menu_box.removeClass(&menu_ani_show&);
menu_box.addClass(&menu_ani_hide&);
more_menu_box_option.hide().css({
&opacity&:0
default_menu_box_option.show().css({
&opacity&:1
$(&.c&).removeClass(&c_mousedown&);
setTimeout(&menu_box.hide()&,300);
shadow.removeClass(&shadow_show&).addClass(&shadow_hide&);
setTimeout(&shadow.hide()&,300);
setTimeout('location.href=url',300);
// setTimeout(tips(tiptext,2,0),300);
+ function sysmenu2skip(skip2url,tiptext){
if(if_scroll==1){
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&#2980B9&,
&opacity&:0.5
menu_button.css({
&background-image&: &url(img/menu_button_0.fw.png)&,
&background-color&:&&,
&opacity&:1
sys_menu.hide();
part_shadow.hide();
menu_button_tap=0;
setTimeout('location.href=url',300);
// setTimeout(tips(tiptext,2,0),300);
+ // 阻止事件冒泡
+ $('.attachs_a').click(function(){event.stopPropagation();});
+ $('.attachs_a').tap(function(){event.stopPropagation();});
+ //隐藏loading
+ $(&#load_tip&).hide();
+ $('.c_content&.feed_img').tap(function(){
event.stopPropagation();
+ // 处理QQ/UC预读问题
+ $(document).on('tap','#prev,#next',function(){
var link = $(this).attr('link');
if(link!=''){
window.location.href=
+ //上传附件
+ $(document).on('tap','#post_twitter_button_file',function(){
var load = $(window.frames[&ajax_iframe&].document).find(&#loaded&).text();
if(load==='OK'){
$('.file_list_view_del').remove();
if($('#post_twitter_input').data('type')==='image'){
if($('#file_list&img').length&9){
$(window.frames[&ajax_iframe&].document).find(&#file&).trigger('click');
tips('最多上传9张图片:)',1,0);
if($('#file_list&img').length&4){
$(window.frames[&ajax_iframe&].document).find(&#file&).trigger('click');
tips('最多上传4个附件:)',1,0);
tips('框架加载失败,请刷新后重试:(',1,0);
+ // 删除附件
+ $(document).on('doubleTap','.file_list_view',function(){
$('.file_list_view').append('&div class=&file_list_view_del&&&/div&');
+ $(document).on('tap','.file_list_view_del',function(){
var id=$(this).parent('.file_list_view').data('id');
var attach_idArray=$('#post_twitter_input').data('attach-id');
attach_idArray=attach_idArray.replace(String(id)+'|','');
$('#post_twitter_input').data('attach-id',attach_idArray);
$(this).parent('.file_list_view').remove();
+ //查看原分享
+ $('.c_zf_box_detail').bind('tap',function(event){
window.location.href=U(&w3g/Index/detail&)+&&weibo_id=&+$(this).data('original-id');
event.stopPropagation();
+ //个人主页发送私信
+ $(document).on('tap','#post-msg-to-uid',function(){
$(&#post_msg_to&).val($(this).data('uname'));
window.location.hash='post-msg-to-uid';
+function switchVideo(number,dowhat,videosite,videourl){
+ window.open(videourl,&&,&fullscreen=1&);
+function tips(x,y,z){
+ if(y==1){
$(&#tip_p&).text(x).removeClass('tip_p_fl');
$('#tip_load').hide();
$(&#tip_ik&).show();
+ }else if(y==0){
$(&#tip_p&).text(x).removeClass('tip_p_fl');
$('#tip_load').hide();
$(&#tip_ik&).hide();
+ }else if(y==2){
$(&#tip_p&).text(x).addClass('tip_p_fl');
$('#tip_load').show();
$(&#tip_ik&).hide();
+ $(&#tip&).show();
+ $(&#tip_shadow&).show();
+ if(z===1){
setTimeout(tiph,2000);
+function tiph(){
+ $(&#tip&).hide();
+ $(&#tip_shadow&).hide();
\ No newline at end of file
Index: z.url.js
===================================================================
--- z.url.js (revision 0)
+++ z.url.js (revision 2)
@@ -0,0 +1,6 @@
+$(function(){
+ $(document).on('click','#login_submit',function(){
window.location.href=$(this).attr('link');
+ $('#load_tip').hide();
\ No newline at end of file
Index: z.password.js
===================================================================
--- z.password.js (revision 0)
+++ z.password.js (revision 2)
@@ -0,0 +1,64 @@
+$(function(){
+ //隐藏loading
+ //载入函数
var U = function(url, params) {
var website = SITE_URL+'/index.php';
url = url.split('/');
if(url[0]=='' || url[0]=='@')
url[0] = APPNAME;
if (!url[1])
url[1] = 'Index';
if (!url[2])
url[2] = 'index';
website = website+'?app='+url[0]+'&mod='+url[1]+'&act='+url[2];
if(params) {
params = params.join('&');
website = website + '&' +
+ $(&#load_tip&).hide();
+ r_s=$(&#reg_submit&);
+ l_s=$(&#login_submit&);
+ mail=$(&#email&);
+ password=$(&#password&);
+ function tips(x,y,z){
$(&#tip_p&).text(x).removeClass('tip_p_fl');
$('#tip_load').hide();
$(&#tip_ik&).show();
}else if(y==0){
$(&#tip_p&).text(x).removeClass('tip_p_fl');
$('#tip_load').hide();
$(&#tip_ik&).hide();
}else if(y==2){
$(&#tip_p&).text(x).addClass('tip_p_fl');
$('#tip_load').show();
$(&#tip_ik&).hide();
$(&#tip&).show();
$(&#tip_shadow&).show();
setTimeout(tiph,2000);
+ function tiph(){
$(&#tip&).hide();
$(&#tip_shadow&).hide();
+ $(document).on('tap','#tip_ik',function(){
+ //tip end!
+ $(document).on('tap','#find_submit',function(){
tips('3G版找回密码功能暂缓开放,敬请关注:)',1,0);
+ var setInputWidth = function(){
$('.ib').width($('.li4input').width()-80);
+ setInputWidth();
+ $(window).resize(function(){
setInputWidth();
\ No newline at end of file
Index: z.notify.js
===================================================================
--- z.notify.js (revision 0)
+++ z.notify.js (revision 2)
@@ -0,0 +1,78 @@
+$(function(){
+//替换系统通知页面连接
+ $(document).on('tap','.c_notify a',function(e){
// var r=new RegExp('^'+SITE_URL,'ig');
var local_r=new RegExp('^http\:\/\/localhost\/svn','ig');//本地测试使用
var url=$(this).attr(&href&);
// url = url.replace(r,'');
url = url.replace(SITE_URL,'');
url = url.replace('http://localhost/svn','');
// url = url.replace(local_r,'');//本地测试使用
if(url ==&/message&){
location.href=U('w3g/Message/index');
if(/^\/[\w]+\/[\w\?\=\&\%]*/ig.test(url)){
if(/^\/space\/[0-9]+/ig.test(url)){
var maid = url.match(/[0-9]+$/ig);
if(maid!=null){
maid=maid[0];
location.href=U('w3g/Index/weibo',new Array('uid='+maid));
}else if(/^\/weibo\/[0-9]+\?uid\=[0-9]+$/ig.test(url)){
var tid = url.match(/[0-9]+/ig);
if(tid!=null){
tid=tid[tid.length-2];
location.href=U('w3g/Index/detail',new Array('weibo_id='+tid));
}else if(/^\/weibo\/[0-9]+\?uid\=[0-9]+\&digg\=1$/ig.test(url)){
var tid = url.match(/[0-9]+/ig);
if(tid!=null){
tid=tid[tid.length-3];
location.href=U('w3g/Index/detail',new Array('weibo_id='+tid));
console.log(url);
if(/^\/index\.php\?app\=public\&mod\=Profile\&act\=index\&uid\=[0-9]+$/ig.test(url)){
var maid = url.match(/[0-9]+$/ig);
if(maid!=null){
maid=maid[0];
location.href=U('w3g/Index/weibo',new Array('uid='+maid));
}else if(/^\/index\.php\?app\=public\&mod\=Index\&act\=detail\&weibo_id\=[0-9]+\&uid\=[0-9]+$/ig.test(url)){
var tid = url.match(/[0-9]+/ig);
if(tid!=null){
tid=tid[tid.length-2];
location.href=U('w3g/Index/detail',new Array('weibo_id='+tid));
}else if(/\/index\.php\?app\=public\&mod\=Profile\&act\=feed\&feed_id\=[0-9]+\&uid\=[0-9]+/ig.test(url)){
var tid = url.match(/[0-9]+/ig);
if(tid!=null){
tid=tid[tid.length-2];
location.href=U('w3g/Index/detail',new Array('weibo_id='+tid));
}else if(/^\/index\.php\?app\=public\&mod\=Message\&act\=index$/ig.test(url)){
location.href=U('w3g/Message/index');
}else if(/^\/index\.php\?app\=public\&mod\=Topic\&act\=index\&k\=[\w\%]+/ig.test(url)){
var key=url.match(/[\w\%]+$/ig);
if(key!=null){
key=key[0];
location.href=U('w3g/Index/doSearch',new Array('key='+key));
}else if(/\/topic\?k\=[\w\%]+/ig.test(url)){
var key=url.match(/[\w\%]+$/ig);
if(key!=null){
key=key[0];
console.log(key);
location.href=U('w3g/Index/doSearch',new Array('key='+key));
// console.log(url);
e.preventDefault();
+ $(document).on('click','.c_notify a',function(e){e.preventDefault();});
+ //替换宽度
+ $('table,td').css(&width&,&auto&);
\ No newline at end of file
Index: z.login.js
===================================================================
--- z.login.js (revision 0)
+++ z.login.js (revision 2)
@@ -0,0 +1,91 @@
+$(function(){
+ //隐藏loading
+ //载入函数
var U = function(url, params) {
var website = SITE_URL+'/index.php';
url = url.split('/');
if(url[0]=='' || url[0]=='@')
url[0] = APPNAME;
if (!url[1])
url[1] = 'Index';
if (!url[2])
url[2] = 'index';
website = website+'?app='+url[0]+'&mod='+url[1]+'&act='+url[2];
if(params) {
params = params.join('&');
website = website + '&' +
+ $(&#load_tip&).hide();
+ r_s=$(&#reg_submit&);
+ l_s=$(&#login_submit&);
+ mail=$(&#email&);
+ password=$(&#password&);
+ function tips(x,y,z){
$(&#tip_p&).text(x).removeClass('tip_p_fl');
$('#tip_load').hide();
$(&#tip_ik&).show();
}else if(y==0){
$(&#tip_p&).text(x).removeClass('tip_p_fl');
$('#tip_load').hide();
$(&#tip_ik&).hide();
}else if(y==2){
$(&#tip_p&).text(x).addClass('tip_p_fl');
$('#tip_load').show();
$(&#tip_ik&).hide();
$(&#tip&).show();
$(&#tip_shadow&).show();
setTimeout(tiph,2000);
+ function tiph(){
$(&#tip&).hide();
$(&#tip_shadow&).hide();
+ $(document).on('tap','#tip_ik',function(){
+ //tip end!
+ l_s.tap(function(){
account=mail.val();
pw=password.val();
if(account==&& || pw==&&){
tips(&邮箱和密码都不能为空&,1,0);
}else if(!r_mail(account)){
tips(&请检查您的帐号格式&,1,0);
}else if(!r_password(pw)){
tips(&密码由字母,数字,符号组成,6-15个字符,区分大小写&,1,0);
tips(&验证中...&,2,0);
console.log(account+&:&+pw);
U('w3g/Public/doLogin'),
&email&:account,
&password&:pw
function(data,status){
// console.log(data);
if(data==1){
location.href=U(&w3g/Public/home&);
tips(data,1,0);
+ var setInputWidth = function(){
$('.ib').width($('.li4input').width()-80);
+ setInputWidth();
+ $(window).resize(function(){
setInputWidth();
\ No newline at end of file
Index: touch.js
===================================================================
--- touch.js (revision 0)
+++ touch.js (revision 2)
@@ -0,0 +1,132 @@
+$(document).ready(function(){
+ //设置变量
+ open_write_twitter=$(&#open_write_twitter&);
+ open_menu=$(&#open_menu&);
+ close_menu=$(&#close_menu&);
+ open_post_twitter=$(&#open_post_twitter&);
+ open_zf_twitter=$(&#open_zf_twitter&);
+ close_post_twitter=$(&#close_post_twitter&);
+ close_zf_twitter=$(&#close_zf_twitter&);
+ post_twitter_input=$(&#post_twitter_input&);
+ zf_twitter=$(&#zf_twitter&);
+ menu=$(&#menu&);
+ post_twitter=$(&#post_twitter&);
+ no=$(&#no&);
+ default_menu_box_option=$(&#default_menu_box_option&);
+ more_menu_box_option=$(&#more_menu_box_option&);
+ open_more=$(&#open_more&);
+ back2_default_menu_box_option=$(&#back2_default_menu_box_option&);
+ post_tip=$(&#post_tip&);
+ menu_box=$(&#menu_box&);
+ c=$(&.c&);
+ var i=0;
var start_x=0;
var start_y=0;
//设置头部图片宽度
function resize_logo(){
logo_width=$(window).width();
logo_height=logo_width/720*300;
$(&#header_logo&).attr({
&width&:logo_width,
&height&:logo_height
$(&#content&).css(&margin-top&,logo_height);
resize_logo();
$(window).resize(function(){
resize_logo();
// window.location.reload();
+ function x_click(x,box){
dw2=$(window).width()/2;
dh2=$(window).height()/2;
box_w=box.width();
box_h=box.height();
x.click(function(e){
to_top=$(document).scrollTop();
page_x=e.pageX-box_w/2*0.1;
page_y=e.pageY-box_h/2*0.1-to_
start_x=page_x;
start_y=page_y;
box.show();
&top&:page_y+&px&,
&left&:page_x+&px&,
// &top&:&50%&,
// &left&:&50%&,
&margin-top&:&-& + box_h/2 + &px&,
&margin-left&:&-25%&
box.removeClass(&menu_ani_hide&);
box.addClass(&menu_ani_show&);
box.animate({
opacity:1,
top:dh2 +&px&,
left:dw2+&px&
$(this).addClass(&c_mousedown&);
// box.fadeOut(500);
box.removeClass(&menu_ani_show&);
box.addClass(&menu_ani_hide&);
box.animate({
top:start_y+&px&,
left:start_x+&px&,
},500,function(){
$(this).hide();
more_menu_box_option.hide();
default_menu_box_option.show();
x.removeClass(&c_mousedown&);
+ }//end of function x_click()
+ function open_box(x,openbox,hidebox){
x.click(function(){
hidebox.slideUp(300);
openbox.slideDown(300);
c.removeClass(&c_mousedown&);
+ //修正i数值
+ function click4i(x,x_i){
x.click(function(){
+ //输入框提示
+ function p_tip(x){
post_tip.text(x);
+ //点开选项菜单
+ x_click(c,menu_box);
+ //打开主菜单
+ open_box(open_menu,menu,menu_box);
+ open_box(close_menu,no,menu);
+ //写分享
+ open_box(open_write_twitter,post_twitter,menu_box);
+ open_write_twitter.click(function(){
post_twitter_input.focus();
p_tip(&发表分享:&);
+ open_box(open_post_twitter,post_twitter,menu_box);
+ open_post_twitter.click(function(){
post_twitter_input.focus();
p_tip(&回复分享:&);
+ open_box(close_post_twitter,no,post_twitter);
+ open_box(open_zf_twitter,zf_twitter,menu_box);
+ open_zf_twitter.click(function(){
zf_twitter_input.focus();
+ open_box(close_zf_twitter,no,zf_twitter);
+ open_box(open_more,more_menu_box_option,default_menu_box_option);
+ open_box(back2_default_menu_box_option,default_menu_box_option,more_menu_box_option);
\ No newline at end of file
Index: zepto.min.js
===================================================================
--- zepto.min.js (revision 0)
+++ zepto.min.js (revision 2)
@@ -0,0 +1,2 @@
+/* Zepto v1.0-1-ga3cab6c - polyfill zepto detect event ajax form fx - /license */
+(function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,&&)}),Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(this===void 0||this===null)throw new TypeEvar c=Object(this),d=c.length&&&0,e=0,f;if(typeof b!=&function&)throw new TypeEif(d==0&&arguments.length==1)throw new TypeEif(arguments.length&=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e&=d)throw new TypeError}while(!0);while(e&d)e in c&&(f=b.call(a,f,c[e],e,c)),e++;return f})})();var Zepto=function(){function E(a){return a==null?String(a):y[z.call(a)]||&object&}function F(a){return E(a)==&function&}function G(a){return a!=null&&a==a.window}function H(a){return a!=null&&a.nodeType==a.DOCUMENT_NODE}function I(a){return E(a)==&object&}function J(a){return I(a)&&!G(a)&&a.__proto__==Object.prototype}function K(a){return a instanceof Array}function L(a){return typeof a.length==&number&}function M(a){return g.call(a,function(a){return a!=null})}function N(a){return a.length&0?c.fn.concat.apply([],a):a}function O(a){return a.replace(/::/g,&/&).replace(/([A-Z]+)([A-Z][a-z])/g,&$1_$2&).replace(/([a-z\d])([A-Z])/g,&$1_$2&).replace(/_/g,&-&).toLowerCase()}function P(a){return a in j?j[a]:j[a]=new RegExp(&(^|\\s)&+a+&(\\s|$)&)}function Q(a,b){return typeof b==&number&&&!l[O(a)]?b+&px&:b}function R(a){var b,c;return i[a]||(b=h.createElement(a),h.body.appendChild(b),c=k(b,&&).getPropertyValue(&display&),b.parentNode.removeChild(b),c==&none&&&(c=&block&),i[a]=c),i[a]}function S(a){return&children&in a?f.call(a.children):c.map(a.childNodes,function(a){if(a.nodeType==1)return a})}function T(c,d,e){for(b in d)e&&(J(d[b])||K(d[b]))?(J(d[b])&&!J(c[b])&&(c[b]={}),K(d[b])&&!K(c[b])&&(c[b]=[]),T(c[b],d[b],e)):d[b]!==a&&(c[b]=d[b])}function U(b,d){return d===a?c(b):c(b).filter(d)}function V(a,b,c,d){return F(b)?b.call(a,c,d):b}function W(a,b,c){c==null?a.removeAttribute(b):a.setAttribute(b,c)}function X(b,c){var d=b.className,e=d&&d.baseVal!==a;if(c===a)return e?d.baseVal:d;e?d.baseVal=c:b.className=c}function Y(a){try{return a?a==&true&||(a==&false&?!1:a==&null&?null:isNaN(b=Number(a))?/^[\[\{]/.test(a)?c.parseJSON(a):a:b):a}catch(d){return a}}function Z(a,b){b(a);for(var c in a.childNodes)Z(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=e.filter,h=window.document,i={},j={},k=h.defaultView.getComputedStyle,l={&column-count&:1,columns:1,&font-weight&:1,&line-height&:1,opacity:1,&z-index&:1,zoom:1},m=/^\s*&(\w+|!)[^&]*&/,n=/&(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^&]*)\/&/ig,o=/^(?:body|html)$/i,p=[&val&,&css&,&html&,&text&,&data&,&width&,&height&,&offset&],q=[&after&,&prepend&,&before&,&append&],r=h.createElement(&table&),s=h.createElement(&tr&),t={tr:h.createElement(&tbody&),tbody:r,thead:r,tfoot:r,td:s,th:s,&*&:h.createElement(&div&)},u=/complete|loaded|interactive/,v=/^\.([\w-]+)$/,w=/^#([\w-]*)$/,x=/^[\w-]+$/,y={},z=y.toString,A={},B,C,D=h.createElement(&div&);return A.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSif(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=D).appendChild(a),d=~A.qsa(e,b).indexOf(a),f&&D.removeChild(a),d},B=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():&&})},C=function(a){return g.call(a,function(b,c){return a.indexOf(b)==c})},A.fragment=function(b,d,e){b.replace&&(b=b.replace(n,&&$1&&/$2&&)),d===a&&(d=m.test(b)&&RegExp.$1),d in t||(d=&*&);var g,h,i=t[d];return i.innerHTML=&&+b,h=c.each(f.call(i.childNodes),function(){i.removeChild(this)}),J(e)&&(g=c(h),c.each(e,function(a,b){p.indexOf(a)&-1?g[a](b):g.attr(a,b)})),h},A.Z=function(a,b){return a=a||[],a.__proto__=c.fn,a.selector=b||&&,a},A.isZ=function(a){return a instanceof A.Z},A.init=function(b,d){if(!b)return A.Z();if(F(b))return c(h).ready(b);if(A.isZ(b))if(K(b))e=M(b);else if(I(b))e=[J(b)?c.extend({},b):b],b=else if(m.test(b))e=A.fragment(b.trim(),RegExp.$1,d),b=else{if(d!==a)return c(d).find(b);e=A.qsa(h,b)}return A.Z(e,b)},c=function(a,b){return A.init(a,b)},c.extend=function(a){var b,c=f.call(arguments,1);return typeof a==&boolean&&&(b=a,a=c.shift()),c.forEach(function(c){T(a,c,b)}),a},A.qsa=function(a,b){return H(a)&&w.test(b)?(c=a.getElementById(RegExp.$1))?[c]:[]:a.nodeType!==1&&a.nodeType!==9?[]:f.call(v.test(b)?a.getElementsByClassName(RegExp.$1):x.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.contains=function(a,b){return a!==b&&a.contains(b)},c.type=E,c.isFunction=F,c.isWindow=G,c.isArray=K,c.isPlainObject=J,c.isEmptyObject=function(a){for(b in a)return!1;return!0},c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.camelCase=B,c.trim=function(a){return a.trim()},c.uuid=0,c.support={},c.expr={},c.map=function(a,b){var c,d=[],e,f;if(L(a))for(e=0;e&a.e++)c=b(a[e],e),c!=null&&d.push(c);else for(f in a)c=b(a[f],f),c!=null&&d.push(c);return N(d)},c.each=function(a,b){var c,d;if(L(a)){for(c=0;c&a.c++)if(b.call(a[c],c,a[c])===!1)return a}else for(d in a)if(b.call(a[d],d,a[d])===!1)return a},c.grep=function(a,b){return g.call(a,b)},window.JSON&&(c.parseJSON=JSON.parse),c.each(&Boolean Number String Function Array Date RegExp Object Error&.split(& &),function(a,b){y[&[object &+b+&]&]=b.toLowerCase()}),c.fn={forEach:e.forEach,reduce:e.reduce,push:e.push,sort:e.sort,indexOf:e.indexOf,concat:e.concat,map:function(a){return c(c.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return c(f.apply(this,arguments))},ready:function(a){return u.test(h.readyState)?a(c):h.addEventListener(&DOMContentLoaded&,function(){a(c)},!1),this},get:function(b){return b===a?f.call(this):this[b&=0?b:b+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(a){return e.every.call(this,function(b,c){return a.call(b,c,b)!==!1}),this},filter:function(a){return F(a)?this.not(this.not(a)):c(g.call(this,function(b){return A.matches(b,a)}))},add:function(a,b){return c(C(this.concat(c(a,b))))},is:function(a){return this.length&0&&A.matches(this[0],a)},not:function(b){var d=[];if(F(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b==&string&?this.filter(b):L(b)&&F(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)&0&&d.push(a)})}return c(d)},has:function(a){return this.filter(function(){return I(a)?c.contains(this,a):c(this).find(a).size()})},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!I(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!I(a)?a:c(a)},find:function(a){var b,d=return typeof a==&object&?b=c(a).filter(function(){var a=return e.some.call(d,function(b){return c.contains(b,a)})}):this.length==1?b=c(A.qsa(this[0],a)):b=this.map(function(){return A.qsa(this,a)}),b},closest:function(a,b){var d=this[0],e=!1;typeof a==&object&&&(e=c(a));while(d&&!(e?e.indexOf(d)&=0:A.matches(d,a)))d=d!==b&&!H(d)&&d.parentNreturn c(d)},parents:function(a){var b=[],d=while(d.length&0)d=c.map(d,function(a){if((a=a.parentNode)&&!H(a)&&b.indexOf(a)&0)return b.push(a),a});return U(b,a)},parent:function(a){return U(C(this.pluck(&parentNode&)),a)},children:function(a){return U(this.map(function(){return S(this)}),a)},contents:function(){return this.map(function(){return f.call(this.childNodes)})},siblings:function(a){return U(this.map(function(a,b){return g.call(S(b.parentNode),function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=&&})},pluck:function(a){return c.map(this,function(b){return b[a]})},show:function(){return this.each(function(){this.style.display==&none&&&(this.style.display=null),k(this,&&).getPropertyValue(&display&)==&none&&&(this.style.display=R(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var b=F(a);if(this[0]&&!b)var d=c(a).get(0),e=d.parentNode||this.length&1;return this.each(function(f){c(this).wrapAll(b?a.call(this,f):e?d.cloneNode(!0):d)})},wrapAll:function(a){if(this[0]){c(this[0]).before(a=c(a));while((b=a.children()).length)a=b.first();c(a).append(this)}return this},wrapInner:function(a){var b=F(a);return this.each(function(d){var e=c(this),f=e.contents(),g=b?a.call(this,d):a;f.length?f.wrapAll(g):e.append(g)})},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css(&display&,&none&)},toggle:function(b){return this.each(function(){var d=c(this);(b===a?d.css(&display&)==&none&:b)?d.show():d.hide()})},prev:function(a){return c(this.pluck(&previousElementSibling&)).filter(a||&*&)},next:function(a){return c(this.pluck(&nextElementSibling&)).filter(a||&*&)},html:function(b){return b===a?this.length&0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(V(this,b,a,d))})},text:function(b){return b===a?this.length&0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){return typeof c==&string&&&d===a?this.length==0||this[0].nodeType!==1?a:c==&value&&&this[0].nodeName==&INPUT&?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)if(I(c))for(b in c)W(this,b,c[b]);else W(this,c,V(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&W(this,a)})},prop:function(b,c){return c===a?this[0]&&this[0][b]:this.each(function(a){this[b]=V(this,c,a,this[b])})},data:function(b,c){var d=this.attr(&data-&+O(b),c);return d!==null?Y(d):a},val:function(b){return b===a?this[0]&&(this[0].multiple?c(this[0]).find(&option&).filter(function(a){return this.selected}).pluck(&value&):this[0].value):this.each(function(a){this.value=V(this,b,a,this.value)})},offset:function(a){if(a)return this.each(function(b){var d=c(this),e=V(this,a,b,d.offset()),f=d.offsetParent().offset(),g={top:e.top-f.top,left:e.left-f.left};d.css(&position&)==&static&&&(g.position=&relative&),d.css(g)});if(this.length==0)var b=this[0].getBoundingClientRect();return{left:b.left+window.pageXOffset,top:b.top+window.pageYOffset,width:Math.round(b.width),height:Math.round(b.height)}},css:function(a,c){if(arguments.length&2&&typeof a==&string&)return this[0]&&(this[0].style[B(a)]||k(this[0],&&).getPropertyValue(a));var d=&&;if(E(a)==&string&)!c&&c!==0?this.each(function(){this.style.removeProperty(O(a))}):d=O(a)+&:&+Q(a,c);else for(b in a)!a[b]&&a[b]!==0?this.each(function(){this.style.removeProperty(O(b))}):d+=O(b)+&:&+Q(b,a[b])+&;&;return this.each(function(){this.style.cssText+=&;&+d})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return e.some.call(this,function(a){return this.test(X(a))},P(a))},addClass:function(a){return this.each(function(b){d=[];var e=X(this),f=V(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&X(this,e+(e?& &:&&)+d.join(& &))})},removeClass:function(b){return this.each(function(c){if(b===a)return X(this,&&);d=X(this),V(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(P(a),& &)}),X(this,d.trim())})},toggleClass:function(b,d){return this.each(function(e){var f=c(this),g=V(this,b,e,X(this));g.split(/\s+/g).forEach(function(b){(d===a?!f.hasClass(b):d)?f.addClass(b):f.removeClass(b)})})},scrollTop:function(){if(!this.length)return&scrollTop&in this[0]?this[0].scrollTop:this[0].scrollY},position:function(){if(!this.length)var a=this[0],b=this.offsetParent(),d=this.offset(),e=o.test(b[0].nodeName)?{top:0,left:0}:b.offset();return d.top-=parseFloat(c(a).css(&margin-top&))||0,d.left-=parseFloat(c(a).css(&margin-left&))||0,e.top+=

我要回帖

更多关于 display table怎么用 的文章

 

随机推荐