我一直想知道是不是因为我文章里每句话都写很短所以关闭侧边栏的时候没有伸缩效果,所以我一句话写这么长看看会发生什么事,我觉得已经很长了,但是为了保证测试的合理性,我要多写一点,这样可以了么…那么手动发布…
我一直想知道是不是因为我文章里每句话都写很短所以关闭侧边栏的时候没有伸缩效果,所以我一句话写这么长看看会发生什么事,我觉得已经很长了,但是为了保证测试的合理性,我要多写一点,这样可以了么…那么手动发布…
补充:首先要用到这段代码:
接下来是JS代码:
$("#menu .nav li:not(#close-sidebar)").hover(function(){$(this).stop().animate({paddingTop:"+=6"}, 240);},function(){$(this).stop().animate({paddingTop:"0"}, 120);});
$('#close-sidebar a').toggle(function(){$(this).text("关侧边栏");$('#sidebar').hide().prev().animate({width: "960px"}, 1000);},function(){$(this).text("开侧边栏");$('#sidebar').show().prev().animate({width: "650px"}, 800);});
不成…文章部分不伸缩…我是CSS盲…咋办?
先暂时搞个移动效果…
$('#close-sidebar a').toggle(function(){$(this).text("开侧边栏");$('#sidebar').hide();$('#wrap').animate({width:"670px"},1000);$('#wrap').css({"background-image":"none",});$('#content').animate({width:"670px"},1000)},function(){$(this).text("关侧边栏");$('#wrap').css({background:"url(/wp-content/themes/zsofa107/images/bg.gif)",});$('#wrap').animate({width:"960px"},800);$('#content').animate({width:"650px"},800);$('#sidebar').show()});
2010年04月4日于20:24
整当我一头雾水地啃苹果时,zwwooooo 凭空出现,在我惊讶的目光中丢下一段话:
@MOPVHS 这个是需要设置 jQ 代码,具体还是去请教木木木木木吧,毕竟 jQ 代码是他折腾的,而且我没用过这段代码(个人觉得没必要),也没空(正在忙付费的主题修改——Sorry,我要赚奶粉钱——有家的人压力大,见谅
)。
主要是这个要花些时间修改+测试,不过以后简单的可以帮你
![]()
哦,想起来了,你伸展了#content,#comments,但你忘了伸展控制文章的.post,试试吧
那啥,一语惊醒梦中人么…内牛满面地改好代码,意料之中地成功了…
谢谢Z大,祝福他女儿快快长大,这样就不用买奶粉了…
![]()
最后,参考CSS中.post的宽度,修改好的代码如下:
$('#close-sidebar a').toggle(function(){ //选中id="close-sidebar"内的a标签的内容,即“干掉侧边栏”
$(this).text("显示侧边栏"); //点击此中内容后改变成“显示侧边栏”
$('#sidebar').hide(); //隐藏id="sidebar"的内容,即“侧边栏”
$('#content').animate({width: "960px"}, 1000); //让id="content",即主体部分的宽度伸长至960px,时间为1000毫秒
$('#content .post').animate({width: "960px"}, 1000);
},function(){
$(this).text("关闭侧边栏"); //点击此中内容后改变成“关闭侧边栏”
$('#sidebar').show(); //显示id="sidebar"的内容,即“侧边栏”
$('#content').animate({width: "650px"}, 800); //让id="content",即主体部分的宽度缩至650px,时间为800毫秒
$('#content .post').animate({width: "640px"}, 800);
});
围观更强大的leeiio的文章:
Internet Explorer 8.0
Windows 7
2010/06/06 @ 3:57 pm on 1
Google Chrome 5.0.375.55
Windows XP
2010/06/06 @ 4:01 pm on 2@小松
当时是JQuery盲,小问题都搞那么久~~~现在总算有清晰的思路了~~~
Internet Explorer 6.0
Windows XP
2010/04/13 @ 8:39 pm on 1实测IE6下浏览会有鼠标不断抖动,浏览器状态栏闪烁效果,哈哈~华丽来
Google Chrome 4.1.249.1045
Windows XP
2010/04/13 @ 8:49 pm on 2@thinknew 哈哈,一下子扔出这么多留言…你好活跃…显然是很久没上网的体现…
Firefox 3.0.15
Ubuntu 8.10
2010/04/10 @ 8:46 pm on 1
Google Chrome 4.1.249.1045
Windows 7
2010/04/05 @ 3:09 pm on 1很多都折腾上了,哟西哟西,又误了一个~
jQuery的选择器是很基本很强大也是很有趣的一个东东~
Google Chrome 4.1.249.1042
Windows XP
2010/04/05 @ 3:37 pm on 2@林木木 呵呵,大部分是从你那里学的…用起来很生疏…现在看来还是系统地学下比较好…
Firefox 3.6.3
Windows XP
2010/04/05 @ 2:26 pm on 1…………………….┏━━━━━━━┓ ………………..
┏┓ ┏┫ ||||||┣┓ ┏┓
┣┫ ┗┫━━ ┃ ━━┣┛ ┣┫
┏┳┫┣┳┓ ┃ ━━━━━ ┃ ┏┳┫┣┳┓
┃老子手贱┃ ┗━━━┳━━━┛ ┃误入此处┃
┗━━━━┻━━━━━▇▇▇━━━━┻━━━━┛
Google Chrome 5.0.366.2
Windows XP
2010/04/05 @ 9:52 pm on 2@屠龙之技 你竟然自己顶……弹弹弹!!
Google Chrome 4.1.249.1042
Windows XP
2010/04/05 @ 9:57 pm on 3@阿修 囧…..追到这里来了…
Google Chrome 5.0.366.2
Windows XP
2010/04/06 @ 9:11 pm on 4@MOPVHS 路过顺便弹弹~~
Firefox 3.0.15
Ubuntu 8.10
2010/04/05 @ 11:11 am on 1I am under back|track 4…
Firefox 3.6.2
Windows 7
2010/04/04 @ 8:25 pm on 1你忘了伸缩控制文章区的class:.post
Google Chrome 4.1.249.1042
Windows XP
2010/04/04 @ 8:39 pm on 2@zwwooooo 内牛满面…我怎么没想到…终于解决了~~~嘿嘿,你的主题一定能换来好多奶粉的~~
Opera 10.51
Windows 7
2010/04/08 @ 10:54 pm on 3@MOPVHS 我的主题没换到一丁点奶粉钱
Google Chrome 4.1.249.1045
Windows XP
2010/04/09 @ 3:48 pm on 4@zwwooooo 淡定…
Firefox 3.6.3
Windows XP
2010/04/04 @ 8:10 pm on 1
Google Chrome 4.1.249.1042
Windows XP
2010/04/04 @ 8:11 pm on 2@屠龙之技
Google Chrome 4.1.249.1042
Windows XP
2010/04/04 @ 10:10 pm on 2@屠龙之技 Comment Mail Notify测试…
Google Chrome 4.1.249.1042
Windows XP
2010/04/04 @ 10:16 pm on 2@屠龙之技 第一次修正后测试…
Google Chrome 4.1.249.1042
Windows XP
2010/04/04 @ 10:21 pm on 2@屠龙之技 第一阶段测试完毕…
Firefox 3.6.3
Windows XP
2010/04/04 @ 6:39 pm on 1也是技術呵~
Google Chrome 4.1.249.1042
Windows XP
2010/04/04 @ 6:41 pm on 2@willin 哇哦,willin大师来了…