Jump to content

asylum

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by asylum

  1. Hah, it's no problem.And what I was talking about with the modulus is what the percent sign is. So when I say 4%3 it doesn't mean 4/3 it means divide 4 by 3 and return the remainder so even if it becomes infinitely large the remainder will never be greater than or equal to 3.
  2. I'd be interested to know if the 'obj.style.property' method works in IE. I don't believe it does but if not then I don't know what else to tell you because the way that I gave you is the XHTML DOM way to do it.
  3. In compiled languages it's called buffer overflow. And array is a series of memory locations mapped by the processor and allocated to your process. When the language does its parsing and creates instructions for the process it tells it which element to get in that segment, but if it tells it to get something outside that segment you can get very strange results.In javascript, it will simply result in an error. Since arrays are indexed starting at 0 the length represents the last index + 1 so you never want to reach the array length or you'll be accessing a null element (well, actually it's worse than null). However that is often used to add elements to an array in javascript. Like this arr[arr.length] = "new value";
  4. That would just be an if statement if I understand you correctly. I suppose it all depends on how you want it to be organized and what things should be grouped where. The following code will do what you're asking but maybe not in the way that you're asking. <xsl:if test="Accessories"> ...your <h3> code here and apply the templates...</xsl:if>
  5. I don't imagine you can wrap a conditional around a template but I do think there's an answer to your problem. I'd have to see exactly how your code is setup to write a copy-paste quick fix but here's the general idea. <xsl:template match="nodeAboveAccessories"> <xsl:choose> <xsl:when test="Accessories> <h3>Accessories</h3> These are items you can buy that require no modifications:<br /> <br clear="all" /> <xsl:apply-templates select="Accessories"/> </xsl:when> <xsl:otherwise> <h3>Accessories</h3> There are no accessories for you. Sorry.<br/> <br clear="all"/> </xsl:otherwise> </xsl:choose></xsl:template>
  6. The array is just so you can declare all the images at one location so it makes changing things and looping easier. And the array isn't being divided by i it's being "modulused". The percent sign means to divide the left number by the right and return the remainder. It's basically used to limit values to a certain number, in this case 3.
  7. Hah, thanks. I don't know why I started so early, I think it was just boredom and that's where my interests took me. Video games to the internet, internet to programming. I created biogaming.net when I was 14 and that's how I got started with php and mysql. But that site died a long time ago and now I have unnaturalfusion.com which doesn't really have a main page it's just where I test all sorts of stuff. Maybe one day it'll have a main page
  8. Age 17HTML/CSS: 4 years agoPHP/MySQL/XHTML: 3 years agoASP.NET: 1 year agoPerl: 5-6 months agoXML/XSLT: a few days ago
  9. Just a thought but you should make sure your pages by themselves are valid xml. By that I mean the .xml and the appropriate schema or dtd file parse correctly.I'm not sure what else besides that I'll have to take a look a little later
  10. I'm fairly certain you need a server-side language to get file information. The only file information support javascript has to my knowledge is loading xml and xhtml files into javascript Document objects.
  11. Honestly, I don't think of many people as really good programmers, no offense to anyone here. What I mean when I say I think someone is a good programmer is they can do what they want efficiently in such a way as to make it infinitely expansible without reorganizing their code. They can see the big picture and they can see stupid little math tricks to shorten loops or simplify code that calculates things. Now I only say I don't know many really good programmers is probably because I don't know any of you :)As for doing things yourself, it all depends on how much time it takes you, learning the php concepts and functions that a message board for example would take is only a day, if that. Writing the actual board could be quite time consuming. It's all about organization and figuring out how to combine the things you learned to make something that works. I can't imagine a shopping cart taking you months no matter how much of a novice you are.In any case, I wish you good luck with your site and all your programming endeavors.
  12. You do it the long way...unfortunately.. function getStyle(obj,stylename){ return document.defaultView.getComputedStyle(obj,"").getPropertyValue(stylename);} and use the appropriate setProperty() function to set the value. It really isn't that annoying from a javascript perspective but more from an xsl point of view. When you have to dynamically generate styles IN stylesheets and maybe even dynamic class names, well that's just asking for errors.
  13. Name Unnatural FusionCost FreeSpace 50GB or soEmail accounts unlimitedAds noContent restriction noneWeb address unnaturalfusion.com email kasper@unnaturalfusion.com about hostingComments Well, it's free and it's my home computer but as a big thank you to W3Schools I'm offering free hosting off of it. I can host your domain or give you a folder or subdomain of my domain. Name might be changing to robofrance.com soon, so watch out. And it's a linux machine so I have php/perl/mysql/.htaccess files etc but no .Net applications, sorry.
  14. <html><head><script type="text/javascript">var i=0;arr = ['novas(base)web.jpg', 'novas(base)web.jpg', 'novas(base)web.jpg'];function changeImg(){ document.b1.src = arr[i++%arr.length]; setTimeout(changeImg,2000);}</script></head><body onload="changeImg()"><form><input type="button" value="dance" onClick="timedImage()"><img border="0" alt="Visit W3Schools!" src="novas(base)web.jpg" name="b1" width="800" height="800" /></form></body></html> try that....setInterval is every 2 seconds, setTimeout is 2 seconds later but only once. And don't forget about nesting quotes and closing parenthesis
  15. try changing a { background-color: #FFFFFF;...} to a { background-color: red;...} and see what happens. I think that's the root of your problem. Just a guess after a quick glance at the code though.
  16. All I know is that unless you define height in the element's inline css (style="height:somanypx") obj.style.height will be undefined. However the AbstractView of the document can get an element's height (or any attribute for that matter) whether it's defined or not. objRef.style.height = document.defaultView.getComputedStyle(objRef,"").getPropertyValue("height"); Now you can use the objRef.style.height property...don't forget to do a parseInt() btw
  17. Full name: BrandonAge: 17Gender: maleCountry: USAState: New MexicoCity: AlbuquerqueEyes: blueHair: blondeSmoking/Drinking/Drugs: NoneMusic: Rock, classical, techno that is actually good...Movies: comedy, sci-fi, sweet tooth for horrorInterests: If it has a chip in it chances are I poke it with a stick periodically Into ALL kinds of programming from the ML languages (OCaml to be specific) to web to C to asm
  18. The div tags that make up the layout are generally referred to as layers or by their id which is usually something like 'container' or 'content'. The following code will center the whole page where 'someid' is the id of the outermost div. #someid { position: relative; margin: 0 auto;}
  19. You probably know but you can tell what the browser is from javascript and can call the right page to set a session variable for their browser type. Also, in CSS there's a trick where you can do the following to get only IE to see certain styles. <style type="text/css">...non ie and stuff that does work in ie...</style><!--[if IE]><style type="text/css">...IE only styles....</style><![endif]-->
  20. Try messing with both position: absolute and position: relative of the snav class. It sounds strange but it's fixed lots of my positioning and height problems. I woudl try position: relative first.Good luck
  21. Haha, I was thinking of another thread. But yeah, I know how to work CSS, I was just having a caching problem so when I refreshed it didn't always refresh the page so I thought things weren't behaving correctly. Everything works now.As far as my menu idea, I don't know how else to say it, it's kinda weird but if I could code it then it would be easy...and I dare say, fun....to traverse/navigate.In the next couple of days look at this site to see if my menu has made progress. I had a half-working version earlier (but I broke it so I'll have to work on fixing it) and now I have the other half working so I just need to combine the two .
  22. Unfortunately no, but I think I'll figure something out.My greater problem at the moment is my test.html. The background image that I am telling it to include isn't being included. I would appreciate it if someone could take a look at it...it's in the directory that I gave a link to earlier.
  23. that's basically what I mean except in that example they use left: -135px which is a hard-coded value and I want to know if there's a way to calculate it using positioning and float values to get the same result.I hope that makes sense o_O
  24. This is just an idea but do you think since the template 'menu' is being called with a document tree from an external document that you no longer need to reference that document and you only need to provide relative uri's as though the document were referencing it as it's own stylesheet?e.g. <?xml version="1.0" encoding="windows-1251"?><!-- DWXMLSource="navigation.xml" --><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:variable name="Nav" select="'navigation.xml'"/><xsl:template name="navigation"><xsl:for-each select="document($Nav,/)"><xsl:call-template name="menu" /></xsl:for-each></xsl:template><xsl:template name="menu"><xsl:for-each select="menu">.........</xsl:for-each></xsl:template></xsl:stylesheet>
×
×
  • Create New...