基本标签应用,移除CSS,在div中间追加加载标签和事件
2012-10-30 14:44
369 查看
<div><label>Some images:</label></div> <div> <img src="images/image.1.jpg" id="hibiscus" alt="Hibiscus"/> <img src="images/image.2.jpg" id="littleBear" title="A dog named Little Bear"/> <img src="images/image.3.jpg" id="verbena" alt="Verbena"/> <img src="images/image.4.jpg" id="cozmo" title="A puppy named Cozmo"/> <img src="images/image.5.jpg" id="tigerLily" alt="Tiger Lily"/> <img src="images/image.6.jpg" id="coffeePot"/> </div> <div id="someDiv">This is a <div> with an id of <tt>someDiv</tt></div> <div title="myTitle1"><span>Hello</span></div> <div title="myTitle2"><span>Goodbye</span></div> <ul class="myList"> <li><a href="http://jquery.com">jQuery supports</a> <ul> <li><a href="css1">CSS1</a></li> <li><a href="css2">CSS2</a></li> <li><a href="css3">CSS3</a></li> <li>Basic XPath</li> </ul> </li> <li>jQuery also supports <ul> <li>Custom selectors</li> <li>Form selectors</li> </ul> </li> </ul> <table id="languages" border="0" cellspacing="1"> <thead> <tr> <th>Language</th> <th>Type</th> <th>Invented</th> </tr> </thead> <tbody> <tr> <td>Java</td> <td>Static</td> <td>1995</td> </tr> <tr> <td>Ruby</td> <td>Dynamic</td> <td>1993</td> </tr> <tr> <td>Smalltalk</td> <td>Dynamic</td> <td>1972</td> </tr> <tr> <td>C++</td> <td>Static</td> <td>1983</td> </tr> </tbody> </table> <form action="" method="put" onsubmit="return false;"> <div> <label>Text:</label> <input type="text" id="aTextField" name="someTextField"/> </div> <div> <label>Radio group:</label> <input type="radio" name="radioGroup" id="radioA" value="A"/> A <input type="radio" name="radioGroup" id="radioB" value="B"/> B <input type="radio" name="radioGroup" id="radioC" value="C"/> C </div> <div> <label>Checkboxes:</label> <input type="checkbox" name="checkboxes" id="checkbox1" value="1"/> 1 <input type="checkbox" name="checkboxes" id="checkbox2" value="2"/> 2 <input type="checkbox" name="checkboxes" id="checkbox3" value="3"/> 3 <input type="checkbox" name="checkboxes" id="checkbox4" value="4"/> 4 </div> <button type="submit" id="submitButton">Submit</button> </form>
body,th,td { font-size: 8pt; background-color: white; } .redBorder, .wrappedElement { border: solid red 1px; } .thickBorder { border-width: 3px; } .seeThrough { opacity: 0.5; filter: alpha(opacity=50); } table { background-color: black; }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="../common.css"> <link rel="stylesheet" type="text/css" href="sample.css"> <script type="text/javascript" src="../scripts/jquery-1.2.1.js"></script> <script type="text/javascript" src="../scripts/support.labs.js"></script> <script type="text/javascript"> function performOperation(operation) { $('*').removeClass('wrappedElement'); eval('var wrappedSet='+operation+';'); wrappedSet.addClass('wrappedElement'); return wrappedSet; } $(function(){ $(document.body).load('sample.dom.html'); }); </script> </head> <body class="plain"> </body> </html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>New <div>s Example</title> <script type="text/javascript" src="../scripts/jquery-1.2.1.js"> </script> <script type="text/javascript"> $(function(){ $("<div class='foo'>I have foo!</div><div>I don 't</div>") .filter(".foo").click(function() { alert("I'm foo!"); }).end().appendTo("#someParentDiv"); }); </script> </head> <body> <div>Div 1</div> <div id="someParentDiv">Div 2</div> <div>Div 3</div> </body> </html>
$("<div class='foo'>I have foo!</div><div>I don 't</div>")
.filter(".foo").click(function() {
alert("I'm foo!");
}).end().appendTo("#someParentDiv"); 加载到某个标签后
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="../common.css"> <link rel="stylesheet" type="text/css" href="sample.css"> <script type="text/javascript" src="../scripts/jquery-1.2.1.js"></script> <script type="text/javascript" src="../scripts/support.labs.js"></script> <script type="text/javascript"> function performOperation(operation) { $('*').removeClass('wrappedElement'); eval('var wrappedSet='+operation+';'); wrappedSet.addClass('wrappedElement'); return wrappedSet; } $(function(){ $(document.body).load('sample.dom.html'); }); </script> </head> <body class="plain"> </body> </html>
相关文章推荐
- 利用DIV+CSS制作网页过程中常用的基本概念及标签使用细节
- 利用DIV+CSS制作网页过程中常用的基本概念及标签使
- div标签、html/css基本样式、canvas画布
- 文字添加响应事件,js动态加载CSS, js弹出DIV
- 应用DIV+CSS布局以后 该在什么时候使用TABLE?
- css基础 设置div标签 宽度 边框线颜色样式 div中文本居中 div块在网页中居中 div中内容距边框线的距离
- CSS中最基本的维持浏览器兼容性的一点:重置标签。
- html和css 常用标签和基本属性
- 常用的DIV+CSS的基本框架结构但不推荐都放一个div里
- JS+DIV+CSS实现的经典标签切换效果代码
- HTML5的Video标签的属性,方法和事件汇总及Video填充满父div的大小
- 金典 DIV+CSS 3行2列 布局详解--企业网站通用的基本布局详解
- HTML&CSS基础学习笔记1.18-DIV标签1
- 在html中div+css布局的简单应用(适合初学者了解)
- 图片(img标签)的onerror事件当图片无法加载时处理
- 转载--让搜索引擎优化(SEO)更有效 CSS+DIV标签命名规范
- Dom2(页面加载事件,标签样式,刷新)
- DIV+CSS布局问题:一个宽度不确定的DIV里面放三个水平对齐的DIV,左右两个DIV宽度固定为150px,中间那个DIV充满剩余的宽度
- DIV+CSS应用_基础知识
- My97DatePicker事件无效,触发事件calendar.js,datepicker.css等文件无法加载