js实现select跳转功能代码
2014-10-22 17:04
651 查看
js简单实现select跳转功能:代码如下
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <div class="selectBox"> <select class="toSlt"> <option href="http://jichuang.gongchang.cn/pro-161264/">全部分类的商品</option> <option href="http://jichuang.gongchang.cn/">普通车床</option> <option href="http://jichuang.gongchang.cn/brand/">回转车床</option> <option href="http://jichuang.gongchang.cn/">普通车床</option> <option href="http://jichuang.gongchang.cn/brand/">回转车床</option> </select> </div> <script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(function(){ var $body = $('body'); $body.on('change', 'select:has(option[href])', function(e) { var _this = $(this), _href = _this.find('option:selected').attr('href');//获取要跳转的地址 location.href = _href; //跳转 }) }) </script> </body> </html>
您可能感兴趣的文章:
相关文章推荐
- js实现select跳转功能代码
- 下拉菜单点击实现连接跳转功能的js代码
- 下拉菜单点击实现连接跳转功能的js代码
- js实现select跳转功能
- jQuery 点击图片跳转上一张或下一张功能的实现代码
- 用js实现键盘方向键翻页功能的代码
- 实现Server.UrlEncode和Server.UrlDecode功能的js代码
- 用js模仿word格式刷功能实现代码 [推荐]
- JS实现即点即编辑功能代码
- 实现QQ爱墙功能的JS代码
- css+js实现select列表横向排列效果代码
- select列表内容交换的js实现代码
- 纯JS转换Select为Combox,完美实现原select所有功能
- JS 页面内容搜索,类似于 Ctrl+F功能的实现代码
- select列表内容交换的js实现代码
- 收藏,对比功能的JS部分实现代码
- js实现页面打印功能实例代码(附去页眉页脚功能代码)
- select下拉选择框美化实现代码(js+css+图片)
- js删除select中重复项的实现代码