Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Fmdpa

  1. Fmdpa


    It's a good start! I've always wanted to attack this challenge, but I've never mustered the courage up to this point. Firefox was the only browser in which it would work well. It worked fine until I got to a score of 80 and then the snake stopped. In IE 9, it wouldn't do anything (even after allowing "ActiveX controls"). In Safari, the snake went crawled straight off the screen without listening to me telling him to "turn". Possibly a problem with capturing the keyboard events. In Opera, I could drive the snake fine, but no dots showed up. It looks like it needs a little more work, but as I said it is a good start!
  2. You could just override them with a stylesheet targeting IE8 and below with a conditional comment: <!--[if lte IE 8]> <style> body { background-image:none; } </style><![endif]--> Don't worry about getting rid of CSS3 properties for IE8 and below. It won't recognize most of CSS3 anyway, so there's nothing to eliminate.
  3. I've gotten this message before too, but I can't reproduce it now...even at the link you gave. Did it just appear as you first loaded the page, or after your clicked the "Try it" button?
  4. My bad. Is there any discussion of ancestor selection in future CSS specs?
  5. Yes, it would only work for a sibling element. I guess you could transverse the node tree with the sibling selector (+) and/or the ancestor selector (>) but that would be rather convoluted.
  6. Yes it is possible. Here's a little example I whipped up (you can paste it here): <html><style>img { padding:20px;}img:hover { border:1px solid red; padding:19px;}img + h1 { position:relative; left:0px; font-size:20px; -o-transition:left 300ms ease, top 500ms ease, font-size 500ms ease; -moz-transition:left 300ms ease, top 500ms ease, font-size 500ms ease; -webkit-transition:left 300ms ease, top 500ms ease, font-size 500ms ease;}img:hover + h1 { left:100px; top:50px; font-size:38px;}</style><body><img src="http://www.cyberstream.us/images/dl.png" /><h1>My First Heading</h1></body></html>
  7. Fmdpa


    Yeah, but I'm biased towards Dragonfly
  8. Fmdpa


    This article might help. Much of my understanding of the meaning of the "this" keyword came from using a developer console, namely Opera Dragonfly. The latest experimental build of Opera Dragonfly has even better support for Javascript Object inspection. How to install the latest experimental build of Opera DragonflyHow to Inspect ObjectsIt is quite easy to inspect JS objects. Here's my favorite way of doing it. Open up the dragonfly console, as seen here. In your javascript code (wherever you want to find out what "this" is) type this:console.log(this) Reload your page (with the Console still open) when the console.log() function is called, you will see something show up in the console. It should have a + sign beside it that will let you expand the object and investigate what "this" contains.
  9. It's interesting that they would implement it like that in the standards. At least it is work-aroundable by explicitly defining which color of transparent you want. I found more related info here http://blogs.msdn.com/b/ie/archive/2011/05...-preview-1.aspx#known issues in IE 10 PP1
  10. That makes sense, but it seems like the browser engineers would make "transparent" equal to the last color stop in the gradient with an alpha opacity of 0.
  11. When I tell the gradient to go from white to transparent, I don't want it to go from white to gray to transparent. The same with black to transparent.
  12. Thanks, that actually solved it for all the browsers. Still would like to see the bug fixed, though.
  13. I'm having trouble with CSS3 gradients:White => transparent background: linear-gradient(bottom, white, transparent); background:-o-linear-gradient(bottom, white, transparent);background:-ms-linear-gradient(bottom, white, transparent); background:-moz-linear-gradient(bottom, white, transparent); background:-webkit-linear-gradient(bottom, white, transparent); background:-webkit-gradient(linear, left bottom, left top, from(white), to(rgba(0, 0, 0, 0))); This gradient, in Safari and Firefox, does not display as I want it to. Instead of going directly from white to transparent, it goes white->gray->transparent. This is not what I want. Black => transparent background: linear-gradient(top, black, transparent); /* standard CSS3 */background: -o-linear-gradient(top, black, transparent); /* Opera */background: -ms-linear-gradient(top, black, transparent); /* IE 10 */background: -moz-linear-gradient(top, black, transparent); /* Firefox */background: -webkit-linear-gradient(top, black, transparent); /* New Webkit */background: -webkit-gradient(linear, left top, left bottom, from(black), to(rgba(0, 0, 0, 0))); /* Old Webkit */ This gradient suffers in IE 10 PP2. Instead of going directly from black to transparent, it does black->gray->transparent. Is there a way I can fix these problems now or must I wait until IE's, Firefox's, and Webkit's gradient rendering engine is fixed?
  14. Most (I think it is 98%...?) browsers do have the Flash plugin which is why it is the most popular choice for websites playing background music. HTML5 has potential in the future.
  15. I should have thought of that. Here's the function I came up with that should fetch all text nodes on a page that are not empty/whitespace and not text nodes that are inside of the given elements. I can't tell whether it is doing what it should. Any comments or suggestions? allElems = document.getElementsByTagName('*')skippedTags = /(nofilter|style|meta)/imfor (i = 0; i < allElems.length; i++) { if (!allElems[i].nodeName.match(skippedTags) && allElems[i].hasChildNodes()) { // iterate through the childNodes of the current element node in the loop IF it isn't a skipped tag for (j = 0; j < allElems[i].childNodes.length; j++) { if (allElems[i].childNodes[j].nodeType == 3 && !allElems[i].childNodes[j].nodeValue.match(/^\w*?$/m)) { // accept *text* nodes that are not empty or plain whitespace allElems[i].childNodes[j].nodeValue = allElems[i].childNodes[j].nodeValue.replace(window.dirtyList, replacement) } } }}
  16. Alright, I was able to successfully extend the NodeList object with this sample test function: NodeList.prototype.getLength = function() { return this.length} This worked. But then I tried to add the filter() function to the NodeList object... NodeList.prototype.filter = function(fun /*, thisp*/) { var len = this.length >>> 0; if (typeof fun != "function") { throw new TypeError(); } var res = []; var thisp = arguments[1]; for (var i = 0; i < len; i++) { if (i in this) { var val = this[i]; // in case fun mutates this if (fun.call(thisp, val, i, this)) { res.push(val); } } } return res; } When I called this: allNodes = allNodes.filter(function(node) { return node.nodeType == 3 // filter out all nodes that are not text nodes}); It emptied the array. Apparently all of the nodes in allNodes were element nodes (nodeType == 1). How can I fetch all text nodes on the page?
  17. I tested the filter() function on Opera's JS console with an array of numbers and it worked fine. But when I tried to filter the array of HTML nodes, it gave me the error. Maybe the nodes aren't actually part of the Array object but rather the NodeList object. ...Actually, I just tested some more and found that NodeList is a function, not an object. If I could determine what object allNodes is, then I could extend it with the function on the MDC documentation page for filter().edit: This is continued work on my Opera extension so I don't have to worry about cross browser compatibility
  18. Fmdpa

    framework questions

    Interestingly, PHP, although usually considered a language, is really a framework-and-language all-in-one. Most languages used on the web are computer programming languages adapted to web use with a framework (e.g. Ruby with the Rails web framework). PHP frameworks, however, have a different purpose since PHP is already a web-based language. PHP frameworks are for rapid development and compatibility (such as dealing with MIME types with the mail() function). Frameworks are basically PHP classes that simplify development. Although good IDEs like Netbeans do speed up development, they are not frameworks. IDEs such as NB do integrate some PHP frameworks, though. There are some good demonstrative screencasts on PHP framework websites like here: http://www.codeigniter.com/ I'm sure others will have good input on the strong points of specific frameworks. There are several object and logic patterns implemented in frameworks that are becoming increasingly important in the web development field these days. You can read more here:Model-View-Controller architectureCRUD application objects and the database interactionActive Record
  19. I'm working on a project in which I want to iterate through all text nodes in the page (excluding empty text nodes) and then I want to wrap words in tags that match any elements in array foo (like when you highlight matched matched keywords on a search results page). First I'm having trouble filtering out nodes that don't match my criteria. allNodes = document.getElementsByTagName('*') skippedTags = /(nofilter|style|meta)/im allNodes = allNodes.filter(function(node) { // only retain nodes that are text nodes and are not empty nodes return (node.nodeType == 3 && node.nodeValue.match(/^\w*?$/gm) && !node.nodeName.match(skippedTags))}); This is giving me the error, "allNodes.filter is not a function".
  20. Fmdpa

    Rss Feeds

    I tried looking too, but I couldn't find much. Are you look for something like an hourly update? Here's a daily one I stumbled over in the search engine: http://silver-and-gold-prices.goldprice.org/This is another website that has the precious metals' prices, but there's no RSS feed that I could find: http://www.kitco.com/market/I would guess that there are APIs that serve real-time prices of gold/silver. If there aren't, it wouldn't be that hard to make one.
  21. Firstly, it would help to know how the menu looks. Also, you should not be putting a semi-colon at the end of this line of selectors: #navigation a:link, a:hover, a:visited, a:active; Properties declared in this^ selector should override the properties declared in this selector: a:link, a:hover, a:visited, a:active a:link, a:hover, a:visited, a:active{font-family:"Times New Roman";font-weight:bold;text-transform:capitalize;color:ff00ff;}#navigation a:link, a:hover, a:visited, a:active{background-color:#c0c0c0;color:#FF0000;display:inline;margin:0;padding:0;border-bottom: 1px solid red;}
  22. Fmdpa

    Web application

    Sounds like the Opera addon, ScribeFire.
  23. Fmdpa

    Web application

    How much of a challenge are you up for? http://w3schools.invisionzone.com/index.php?showtopic=36708
  24. Yeah, I've always used parseInt() for that application, so I haven't noticed that difference. Interesting observation though!
  25. Occasionally it is quirky with Twitter (not often) it doesn't work with the Amazon MP3 store (user control panel). I can't think of any good examples now, but I know I've encountered them in the past. I'll try to remember some better examples...
  • Create New...