| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|---|
| 2 | <html> |
|---|
| 3 | <head> |
|---|
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
|---|
| 5 | <title></title> |
|---|
| 6 | <script type="text/javascript" src="../../lib/prototype.js"></script> |
|---|
| 7 | <script type="text/javascript" src="../../src/scriptaculous.js?load=effects"></script> |
|---|
| 8 | <script type="text/javascript"> |
|---|
| 9 | //<![CDATA[ |
|---|
| 10 | |
|---|
| 11 | Li = { |
|---|
| 12 | onMouseDown_image: function(event) { |
|---|
| 13 | new Effect.Highlight(this, {keepBackgroundImage:true}); |
|---|
| 14 | }, |
|---|
| 15 | onMouseDown_without: function(event) { |
|---|
| 16 | new Effect.Highlight(this); |
|---|
| 17 | } |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | window.onload = function() { |
|---|
| 21 | var li = $("with").getElementsByTagName('LI'); |
|---|
| 22 | for (var i = 0; i < li.length; i++) { |
|---|
| 23 | li[i].onmousedown = Li.onMouseDown_image.bindAsEventListener(li[i]); |
|---|
| 24 | } |
|---|
| 25 | var li = $("without").getElementsByTagName('LI'); |
|---|
| 26 | for (i = 0; i < li.length; i++) { |
|---|
| 27 | li[i].onmousedown = Li.onMouseDown_without.bindAsEventListener(li[i]); |
|---|
| 28 | } |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | //]]> |
|---|
| 32 | </script> |
|---|
| 33 | <style type="text/css"> |
|---|
| 34 | body { |
|---|
| 35 | color: black; |
|---|
| 36 | background-color: white; |
|---|
| 37 | font-family: Verdana, Arial, Helvetica, sans-serif; |
|---|
| 38 | } |
|---|
| 39 | ul { |
|---|
| 40 | list-style: none; |
|---|
| 41 | margin:0; padding:0; |
|---|
| 42 | } |
|---|
| 43 | li { |
|---|
| 44 | margin: 3px 0; padding: 3px 3em 3px 24px; |
|---|
| 45 | border: 2px solid #456; |
|---|
| 46 | background-image: url(icon.png); |
|---|
| 47 | background-repeat: no-repeat; |
|---|
| 48 | background-position: 3px 3px; |
|---|
| 49 | } |
|---|
| 50 | #with li {background-color: #cde;} |
|---|
| 51 | #without li {background-color: #ced;} |
|---|
| 52 | </style> |
|---|
| 53 | </head> |
|---|
| 54 | <body> |
|---|
| 55 | <p>Test of <code>keepBackgroundImage</code> parameter for <code>Effect.Highlight</code>. Click items to show effect.</p> |
|---|
| 56 | <p>With the <code>keepBackgroundImage</code> parameter.</p> |
|---|
| 57 | <ul id="with"> |
|---|
| 58 | <li>One</li> |
|---|
| 59 | <li>Two</li> |
|---|
| 60 | <li>Three</li> |
|---|
| 61 | </ul> |
|---|
| 62 | |
|---|
| 63 | <p>Without the parameter.</p> |
|---|
| 64 | <ul id="without"> |
|---|
| 65 | <li>One</li> |
|---|
| 66 | <li>Two</li> |
|---|
| 67 | <li>Three</li> |
|---|
| 68 | </ul> |
|---|
| 69 | </body> |
|---|
| 70 | </html> |
|---|