code_junkie

Using Javascript in CSS

Nov 13th, 2011
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. width:expression(document.body.clientWidth > 800? "800px": "auto" );
  2.  
  3. body {
  4. behavior:url(script.htc);
  5. }
  6.  
  7. <PUBLIC:COMPONENT TAGNAME="xss">
  8. <PUBLIC:ATTACH EVENT="ondocumentready" ONEVENT="main()" LITERALCONTENT="false"/>
  9. </PUBLIC:COMPONENT>
  10. <SCRIPT>
  11. function main()
  12. {
  13. alert("HTC script executed.");
  14. }
  15. </SCRIPT>
  16.  
  17. body {
  18. -moz-binding: url(script.xml#mycode);
  19. }
  20.  
  21. <?xml version="1.0"?>
  22. <bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml">
  23.  
  24. <binding id="mycode">
  25. <implementation>
  26. <constructor>
  27. alert("XBL script executed.");
  28. </constructor>
  29. </implementation>
  30. </binding>
  31.  
  32. </bindings>
  33.  
  34. document.getElementById("myp").style.color = "#336699";
  35. <p id="myp">This is my story. This is my song.</p>
  36.  
  37. $("p#myp").css("color","#336699");
  38.  
  39. width:expression(document.body.clientWidth > 955 ? "955px": "100%" );
  40.  
  41. body
  42. {
  43. margin: 0px;
  44. font-family: Verdana;
  45. background-color: #cccccc;
  46. background-image: url('<?php
  47. echo 'images/flag_bg/' . $user_country . '.png';
  48. ?>');
  49. }
  50.  
  51. body
  52. {
  53. background-color: <?php echo $user_theme['BG_COLOR']; ?>;
  54. color: <?php echo $user_theme['COLOR']; ?>;
  55. font-family: <?php echo $user_theme['FONT']; ?>;
  56. }
  57.  
  58. #panel
  59. {
  60. font-size: <?php echo $user_theme['FONT_SIZE']; ?>;
  61. background-image: <?php echo $user_theme['PANEL_BG']; ?>;
  62. }
Add Comment
Please, Sign In to add comment