Please tell me how to achieve the following effects? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:04:24
Original
1100 people have browsed it





Please tell me how to achieve the above effect. Select "Boy", the "Boy" button turns blue, and the "Girl" button turns gray; select "Girl", "Boy" button turns gray and the "Girls" button turns blue.


Reply to the discussion (solution)

You use the debugging tool to capture the html tag and see what the style is. If it is a css class, Just switch the class when clicking. Modify the className attribute to control the css
If it is the background color written in the style, change the style.backgroundColor in the click event

If it is a mobile development, then You can consider jquery mobile

to view the form elements in juqery mobile

If it is mobile development, then you can consider jquery mobile

to view the form elements in The display form under juqery mobile



is exactly the development of mobile terminal. First of all, thank you for the link you provided, it is very useful. But it's strange. I copied the code and used it directly, but the effect is not working. Is there any other settings?

Have you introduced the file
jquery.mobile-1.4.2.min.css
jquery.mobile-1.4.2.min.js

If not, you You can download it and then import it to the page

Download address

Why are the "Gender:" and "Boy, Girl" buttons not in the same line? The code is as follows:
----------------------------------------------- -------------------------------------------------- ----------------------------------



Last name:





Name:




-BOTTOM: 8px">



Gender:




  




Throw it directly into the browser, what’s the problem


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><link rel="stylesheet" href="http://demos.jquerymobile.com/1.4.2/css/themes/default/jquery.mobile-1.4.2.min.css">    <script src="http://demos.jquerymobile.com/1.4.2/js/jquery.js"></script>    <script src="http://demos.jquerymobile.com/1.4.2/js/jquery.mobile-1.4.2.min.js"></script></head><body><fieldset data-role="controlgroup" data-type="horizontal">    <legend>Horizontal controlgroup, radio:</legend>    <input type="radio" name="radio-choice-h-2" id="radio-choice-h-2a" value="on" checked="checked">    <label for="radio-choice-h-2a">男</label>    <input type="radio" name="radio-choice-h-2" id="radio-choice-h-2b" value="off">    <label for="radio-choice-h-2b">女</label></fieldset></body></html>
Copy after login

Add a color style

temp.html代码如下:











  

    

      
      
  
  
      
  
  

    
    
    
    
    

  
      
    

  






-------------------------------------------------------------------------------
temp1.html代码如下:












  
    
      姓氏
      
  
  名字
      
  
  
    
    男孩1
    
    女孩1
    

  
      
    
  






-----------------------------------------------------------------------

正常情况下,在temp.html页面点提交应转到temp1.html页面,而temp1.html页面点提交应转到temp.html页面。

但是现在的情况是不管是在temp.html页面点提交还是在temp1.html页面点提交,都是“该页无法显示”,请教原因?

Related labels:
source:php.cn
Previous article:Less Development Guide (3) - Code File Tracking and Debugging_html/css_WEB-ITnose Next article:Use TabHost and RadioButton to achieve page navigation effect
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template