var introduces = {

        inIt : function(){

            introduces.imgLoad();

            introduces.showMore(0,'hioh',86);
introduces.showMore(1,'hiohs',147); $("#normal span").hover( function(){
$(this).addClass('cur');
}, function(){
$(this).removeClass('cur');
} ); }, imgLoad : function(){ var mw = 500, mh = 500, gw = function(w,h){ return Math.round(w/h*mh); }, gh = function(w,h){ return Math.round(h/w*mw); }, hary = [], imgs = $("#temp4 img"); $("#temp4 img").each(function(){ var w = $(this).width(),
h = $(this).height(); if(w > mw){
$(this).css({'width':mw,'height':gh(w,h)});
} if(h > mh){
$(this).css({'width':gw(w,h),'height':mh}); }
hary.push($(this).height()); }); var ht = Math.max.apply(Math,hary); $('.wrap').css({'height':ht,'line-height':ht+'px'}); }, showMore : function(unms,classname,conh){
var con = $("#con"+unms),
h = con.height(),
parent = con.parent();
if(h > conh){
parent.after('<div class="wmore"><span class="mores" id="mores'+unms+'">展开更多</span>');
}else{
parent.removeClass(classname);
} $("#mores"+unms).click(function(){ if($(this).hasClass('moress')){ $(this).removeClass('moress');
$(this).text('展开更多');
$(this).parent().prev().addClass(classname); }else{ $(this).addClass('moress');
$(this).text('收起');
$(this).parent().prev().removeClass(classname); } }); } }; introduces.inIt();

js展开更多的更多相关文章

  1. ExpandableListView实现展开更多和收起更多

    [需求]: 如上面图示 当点开某个一级菜单的时候,其他菜单收起: 子级菜单默认最多5个: 多于5个的显示"展开更多" 点击"展开更多",展开该级所有子级菜单,同 ...

  2. cell左右滑动展开更多按钮-MGSwipeTableCell

    MGSwipeTableCell是一个UITableViewCell的子类, 它实现了左,右滑动展开更多按钮用来实现一些相关操作就和QQ好友列表滑动展开的按钮一样,封装的很好,动画效果也处理很到位,废 ...

  3. js 展开&收缩 二种

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. js展开一颗树

    Tree View 指令不支持 树结构数据源, 只支持单层数组.(也许是我没发现,人家可以设置) .我只能把树展开,变成单层数组.然后还要记录已经递归到第一层了.比如这样. <!doctype ...

  5. js 展开/收起效果

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. 原生态js展开高度自适应100%

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. 原生态js展开收缩

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. js展开循环

    当要对一个大数组进行循环时,通常会通过局部变量缓存数组长度来提高性能,例: for(var i=0,len=arr.len;i<len;i++){} 光是缓存数组长度或使用倒序遍历来减少判断外, ...

  9. [js]展开运算符

    function f(...args){ console.log(args); } f(1,2,3,4,5) [...args] = [1,2,3,4] function f(...args){ co ...

随机推荐

  1. Azure PowerShell (一)如何安装和配置 Azure PowerShell

    什么是 Azure PowerShell? Azure PowerShell 是一组模块,提供用于通过 Windows PowerShell 管理 Azure 的 cmdlet.你可以使用 cmdle ...

  2. Spring 事务模型

    一.三种事务模型 1.本地事务模型:开发人员不用知道事务的存在,事务全部交给数据库来管理,数据库自己决定什么时候提交或回滚,所以数据库是事务的管理者. Connection conn=jdbcDao. ...

  3. easyUI 比较时间大小

    //                    function toDate(str){ //                        var sd=str.split("-" ...

  4. Windows服务定时运行,判断当前时间是否在配置时间段内

    /// <summary> /// 判断程序是否在设置运行时间内 /// </summary> /// <param name="startTime" ...

  5. MySQL之select查询、function函数

    一.select查询 //查询某张表所有数据 select * from temp; //查询指定列和条件的数据 //查询name和age这两列,age等于22的数据 ; //as对列重命名 //as ...

  6. c#中字符串显示上标和下标解决办法

    由于工作的需求,需要在word中插入带入带有上标和下标的字符串,比如这样的一个字符串:SO₄²⁻(mg/L).在网上搜了好久,终是摸索出点思路. 解决办法:使用转义字符加Unicode的HexEnti ...

  7. 常用ASP函数的封装

    做ASP开发常常需要用到一些小功能,这些功能通常我们都会封装成函数来使用,本教程提供了许多我们经常用到的ASP函数. <% '所有功能函数名如下: ' StrLength(str) 取得字符串长 ...

  8. 配置WindowsLiveWriter,写cnblogs博客

    转载:http://www.haogongju.net/art/2307587 引言 以前写博客一般都是联网在cnblogs上面写,不好的地方就是不联网就写不了,当然我们也可以先记录在word文件,等 ...

  9. list,tuple,dict,字符串常用知识总结

    创建列表 sample_list = ['a',1,('a','b')] Python 列表操作 sample_list = ['a','b',0,1,3] 得到列表中的某一个值 value_star ...

  10. 编译gd-2.0.35.tar.gz时报错:gd_png.c:16:53: error: png.h: No such file or directory

    编译gd-2.0.35.tar.gz时报错: gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/freetype/include/freetype2 -I/us ...