仿新浪下拉菜单的实现

本文介绍了如何使用HTML和JavaScript来创建仿新浪样式的效果,包括HTML元素的构建,元素的获取,以及具体的实现代码,最终呈现出下拉菜单的功能。
摘要由CSDN通过智能技术生成

1.HTML元素

css略

<div>
        <ul>
            <li> <a href="#">新浪导航</a>
                <ul>
                    <li>4655</li>
                    <li>8979</li>
                    <li>4548</li>
                </ul>
            </li>
            <li> <a href=&
源码HyPopMenuView,该案例HyPopMenuView模仿新浪微博弹出菜单, Manually Import【手动导入】 【将HyPopMenuView,UIColor ImageGetColor,MenuLabel所有源代码拽入项目中】 【导入主头文件:#import "HyPopMenuView.h"】 HyPopMenuView.h HyPopMenuView.m UIColor ImageGetColor.h UIColor ImageGetColor.m MenuLabel.h MenuLabel.m Example【示例】 NSArray *Objs = @[ [MenuLabel CreatelabelIconName:@"tabbar_compose_idea" Title:@"文字"], [MenuLabel CreatelabelIconName:@"tabbar_compose_photo" Title:@"相册"], [MenuLabel CreatelabelIconName:@"tabbar_compose_camera" Title:@"拍摄"], [MenuLabel CreatelabelIconName:@"tabbar_compose_lbs" Title:@"签到"], [MenuLabel CreatelabelIconName:@"tabbar_compose_review" Title:@"点评"], [MenuLabel CreatelabelIconName:@"tabbar_compose_more" Title:@"更多"], ]; CGFloat x,y,w,h; x = CGRectGetWidth(self.view.bounds)/2 - 213/2; y = CGRectGetHeight([UIScreen mainScreen].bounds)/2 * 0.3f; w = 213; h = 57; //自定义的头部视图 UIImageView *topView = [[ImageView alloc] initWithFrame:CGRectMake(x, y, w, h)]; topView.image = [UIImage imageNamed:@"compose_slogan"]; topView.contentMode = UIViewContentModeScaleAspectFit; NSMutableDictionary *AudioDictionary = [NSMutableDictionary dictionary]; //添加弹出菜单音效 [AudioDictionary setObject:@"composer_open" forKey:kHyPopMenuViewOpenAudioNameKey]; [AudioDictionary setObject:@"wav" forKey:kHyPopMenuViewOpenAudioTypeKey]; //添加取消菜单音效 [AudioDictionary setObject:@"composer_close" forKey:kHyPopMenuViewCloseAudioNameKey]; [AudioDictionary setObject:@"wav" forKey:kHyPopMenuViewCloseAudioTypeKey]; //添加选中按钮音效 [AudioDictionary setObject:@"composer_select" forKey:kHyPopMenuViewSelectAudioNameKey]; [AudioDictionary setObject:@"wav" forKey:kHyPopMenuViewSelectAudioTypeKey]; [HyPopMenuView CreatingPopMenuObjectItmes:Objs TopView:topView OpenOrCloseAudioDictionary:Audio
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值