107
<!doctype html><html lang="en"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Digg-Style Radio Select Buttons</title> <meta name="author" content="Jake Rocheleau"> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script><!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--></head>
<form name="diggform" id="diggform" method="post" action="index.html"> <header id="cathead"> <h2>Choose a Topic</h2> <p>Tell us where your submission should be listed. Select a category below which best represents your news.</p> </header> <!-- radio list --> <input type="radio" name="category" value="apple"> <input type="radio" name="category" value="design"> <input type="radio" name="category" value="gadgets"> <input type="radio" name="category" value="hardware"> <input type="radio" name="category" value="technews"> <input type="radio" name="category" value="linuxunix"> <input type="radio" name="category" value="microsoft"> ...
<div class="row"> <h3>Technology</h3> <a href="#" class="c" id="apple">Apple</a> <a href="#" class="c" id="design">Design</a> <a href="#" class="c" id="gadgets">Gadgets</a> <a href="#" class="c" id="hardware">Hardware</a> <a href="#" class="c" id="technews">Industry News</a> <a href="#" class="c" id="linuxunix">Linux/Unix</a> <a href="#" class="c" id="microsoft">Microsoft</a> <a href="#" class="c" id="mods">Mods</a> <a href="#" class="c" id="programming">Programming</a> <a href="#" class="c" id="security">Security</a></div>
#catlinks .row { display: block; border-bottom: 1px solid #dbdbdb; margin-bottom: 5px; padding: 11px 4px; padding-bottom: 18px; font-size: 1.2em; }#catlinks .row h3 { display: inline-block; color: #5c5c5c; font-weight: bold; width: 140px; }#catlinks .row a { font-size: 0.9em; font-weight: bold; padding: 7px 8px; margin-right: 3px; border: 1px solid #fff; }#catlinks .row a:hover { border: 1px solid #dbdbdb; background: #eee; }#catlinks .row a.sel { background: #6b7fdd; color: #fff; border: 1px solid #6470a9; }#catlinks .row a.sel:hover { background: #4964e1; }
input[type=radio] { display: none; /* comment out to display all radio buttons */ }
$(document).ready(function(){ $(".row a").on("click", function(e){ e.preventDefault(); if($(this).hasClass("sel")) { // already selected } else {
$("a.sel").removeClass("sel"); $(this).addClass("sel"); var rid = $(this).attr('id'); var value = '[value="'+rid+'"]'; $('input:radio[name="category"]').filter(value).attr('checked', true); } });});
最新文章
2019.08.17
海淀做网站:为新用户打造成功的入职体验
2019.08.17
海淀网站设计:浏览器中的原型设计之设计人员的提示和工具
2019.08.17
海淀网站制作:设计Airbnb的网站之交互式样机练习
2019.07.01
海淀建站:为网站增添人性化的温暖与个性
2019.07.01
海淀建站:我的旧设计项目教会了我什么
2019.07.01
海淀建站:对别人设计的网站收取同样的费用?
2019.07.01
海淀网站建设:混合实心字体和空心字体对比
2019.07.01
海淀网站设计:5条更安全的WordPress网站提示
2019.05.27
海淀公司建站:什么时候应该重新设计你的网站?
2019.05.27
海淀企业网站制作:带有css和jQuery的经典Digg样式单选按钮
随机推荐
2019.08.17
海淀网站设计:浏览器中的原型设计之设计人员的提示和工具
2019.05.27
海淀网站建设设计:成功移动用户体验的关键要素
2019.05.27
海淀企业网站开发:如何在WordPress中优化使用分类法
2019.07.01
海淀建站:对别人设计的网站收取同样的费用?
2019.05.27
海淀做网站:解WordPress‘Comms.php的秘密
2019.07.01
海淀网站设计:5条更安全的WordPress网站提示
2019.07.01
海淀建站:为网站增添人性化的温暖与个性
2019.07.01
海淀网站建设:混合实心字体和空心字体对比
2019.05.27
海淀公司建站:什么时候应该重新设计你的网站?
2019.08.17
海淀做网站:为新用户打造成功的入职体验